Package com.io7m.cedarbridge.runtime.api
Class CBSerializerDirectoryMutable
java.lang.Object
com.io7m.cedarbridge.runtime.api.CBSerializerDirectoryMutable
- All Implemented Interfaces:
CBSerializerDirectoryType
A mutable serializer directory.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCollection(CBSerializerCollection collection) Add all serializers in the collection to the directory.voidaddSerializer(CBSerializerFactoryType<?> serializer) Add the serializer to the directory.<T extends CBSerializableType>
CBSerializerType<T>serializerFor(CBQualifiedTypeName typeName, List<CBTypeArgument> arguments) Find a serializer for the given type name and arguments.
-
Constructor Details
-
CBSerializerDirectoryMutable
public CBSerializerDirectoryMutable()Construct a serializer directory.
-
-
Method Details
-
addCollection
Add all serializers in the collection to the directory. This is equivalent to callingaddSerializer(CBSerializerFactoryType)to every member of the collection in order, accumulating the exceptions and then raising an exception at the end if any exceptions were raised.- Parameters:
collection- The collection
-
addSerializer
Add the serializer to the directory.- Parameters:
serializer- The serializer
-
serializerFor
public <T extends CBSerializableType> CBSerializerType<T> serializerFor(CBQualifiedTypeName typeName, List<CBTypeArgument> arguments) Description copied from interface:CBSerializerDirectoryTypeFind a serializer for the given type name and arguments.- Specified by:
serializerForin interfaceCBSerializerDirectoryType- Type Parameters:
T- The type of serialized values- Parameters:
typeName- The type namearguments- The arguments- Returns:
- A serializer
-