Package com.lucimber.dbus.codec.decoder
Interface DecoderFactory
- All Known Implementing Classes:
DefaultDecoderFactory
public interface DecoderFactory
Factory interface for creating D-Bus decoders.
This factory provides a centralized way to create decoders for different D-Bus types, eliminating the need for switch statements and improving extensibility.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if a decoder is available for the specified type.boolean
Checks if a decoder is available for the specified type code.createDecoder
(Type type) Creates a decoder for the specified D-Bus type.createDecoder
(TypeCode typeCode) Creates a decoder for the specified D-Bus type code.
-
Method Details
-
createDecoder
Creates a decoder for the specified D-Bus type code.- Parameters:
typeCode
- the D-Bus type code to decode- Returns:
- a decoder capable of decoding the specified type
- Throws:
DecoderException
- if no decoder is available for the type
-
createDecoder
Creates a decoder for the specified D-Bus type.- Parameters:
type
- the D-Bus type to decode- Returns:
- a decoder capable of decoding the specified type
- Throws:
DecoderException
- if no decoder is available for the type
-
canDecode
Checks if a decoder is available for the specified type code.- Parameters:
typeCode
- the D-Bus type code to check- Returns:
- true if a decoder is available, false otherwise
-
canDecode
Checks if a decoder is available for the specified type.- Parameters:
type
- the D-Bus type to check- Returns:
- true if a decoder is available, false otherwise
-