Package com.io7m.cedarbridge.runtime.api

# Class CBSerializerDirectoryMutable

java.lang.Object
com.io7m.cedarbridge.runtime.api.CBSerializerDirectoryMutable

All Implemented Interfaces:
  `CBSerializerDirectoryType`

public final class CBSerializerDirectoryMutable extends Object implements CBSerializerDirectoryType
A mutable serializer directory.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CBSerializerDirectoryMutable()`
  Construct a serializer directory.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addCollection(CBSerializerCollection collection)`
  Add all serializers in the collection to the directory.
  `void`
  `addSerializer(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.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CBSerializerDirectoryMutable

    public CBSerializerDirectoryMutable()
    Construct a serializer directory.

- ## Method Details

  - ### addCollection

    public void addCollection(CBSerializerCollection collection)
    Add all serializers in the collection to the directory. This is equivalent to calling `addSerializer(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

    public void addSerializer(CBSerializerFactoryType<?> serializer)
    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: `CBSerializerDirectoryType`
    Find a serializer for the given type name and arguments.
    Specified by:
      `serializerFor` in interface `CBSerializerDirectoryType`
    Type Parameters:
      `T` - The type of serialized values
    Parameters:
      `typeName` - The type name
      `arguments` - The arguments
    Returns:
      A serializer