Package com.io7m.cedarbridge.runtime.api
Interface CBProtocolSerializerFactoryType<T extends CBProtocolMessageType>
- Type Parameters:
T- The type of serialized values
A serializer factory for protocols.
-
Method Summary
Modifier and TypeMethodDescriptioncreate(CBSerializerDirectoryType directory) Create a new serializer.id()default <U extends T>
Optional<CBProtocolSerializerFactoryType<U>>matches(long version) If this serializer factory has versionversionthen return it.default <U extends T>
Optional<CBProtocolSerializerFactoryType<U>>If this serializer factory has versionversionand serializes messages of typeclazz, then return it.default <U extends T>
Optional<CBProtocolSerializerFactoryType<U>>If this serializer factory serializes messages of typeclazz, then return it.longversion()
-
Method Details
-
id
UUID id()- Returns:
- The unique ID of the protocol
-
version
long version()- Returns:
- The version of the protocol implemented by this serializer
-
serializes
- Returns:
- The base class of serialized messages
-
create
Create a new serializer.- Parameters:
directory- The directory of available serializers- Returns:
- A new serializer
-
matches
If this serializer factory has versionversionthen return it. Otherwise, return nothing.- Type Parameters:
U- The type of protocol messages- Parameters:
version- The protocol version- Returns:
- This, or nothing
-
matches
default <U extends T> Optional<CBProtocolSerializerFactoryType<U>> matches(long version, Class<U> clazz) If this serializer factory has versionversionand serializes messages of typeclazz, then return it. Otherwise, return nothing.- Type Parameters:
U- The type of protocol messages- Parameters:
version- The protocol versionclazz- The type of protocol messages- Returns:
- This, or nothing
-
matches
If this serializer factory serializes messages of typeclazz, then return it. Otherwise, return nothing.- Type Parameters:
U- The type of protocol messages- Parameters:
clazz- The type of protocol messages- Returns:
- This, or nothing
-