Interface SerializationContext.InstanceMarshallerProvider<T>

Enclosing interface:
SerializationContext

public static interface SerializationContext.InstanceMarshallerProvider<T>
Interface to be implemented for dynamic lookup of marshallers where the type is part of the entity being marshalled.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the Java type handled by this marshaller.
    Get a marshaller to unmarshall the supplied type name or @code null} if the type cannot be unmarshalled by this provider.
    getMarshaller(T instance)
    Get marshaller given a instance to be marshalled or null if the instance cannot be marshalled by this provider.
    getTypeName(T instance)
     
    Returns the protobuf types handled by this marshaller.
  • Method Details

    • getJavaClass

      Class<T> getJavaClass()
      Returns the Java type handled by this marshaller. This must not change over multiple invocations.
      Returns:
      the Java type.
    • getTypeNames

      Set<String> getTypeNames()
      Returns the protobuf types handled by this marshaller. This must not change over multiple invocations.
      Returns:
      the protobuf types.
    • getTypeName

      String getTypeName(T instance)
    • getMarshaller

      BaseMarshaller<T> getMarshaller(T instance)
      Get marshaller given a instance to be marshalled or null if the instance cannot be marshalled by this provider.
    • getMarshaller

      BaseMarshaller<T> getMarshaller(String typeName)
      Get a marshaller to unmarshall the supplied type name or @code null} if the type cannot be unmarshalled by this provider.