Package com.lucimber.dbus.codec.encoder
Interface EncoderFactory
- All Known Implementing Classes:
DefaultEncoderFactory
public interface EncoderFactory
Factory interface for creating D-Bus encoders.
This factory provides a centralized way to create encoders for different D-Bus types, eliminating the need for switch statements and improving extensibility.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if an encoder is available for the specified type.createEncoder
(Type type, ByteOrder order) Creates an encoder for the specified D-Bus type.
-
Method Details
-
createEncoder
Creates an encoder for the specified D-Bus type.- Parameters:
type
- the D-Bus type to encodeorder
- the byte order to use for encoding- Returns:
- an encoder capable of encoding the specified type
- Throws:
EncoderException
- if no encoder is available for the type
-
canEncode
Checks if an encoder is available for the specified type.- Parameters:
type
- the D-Bus type to check- Returns:
- true if an encoder is available, false otherwise
-