Class ProtobufCodecFactory

java.lang.Object
org.jwcarman.codec.protobuf.ProtobufCodecFactory
All Implemented Interfaces:
CodecFactory

public class ProtobufCodecFactory extends Object implements CodecFactory
Produces codecs for Protocol Buffers messages (GeneratedMessage subclasses), using each message type's own Parser. Parameterized types are not supported.
  • Constructor Details

    • ProtobufCodecFactory

      public ProtobufCodecFactory()
      Creates the factory.
  • Method Details

    • create

      public <T> Codec<T> create(TypeRef<T> typeRef)
      Description copied from interface: CodecFactory
      Creates a codec for the given type reference, supporting full generic types.
      Specified by:
      create in interface CodecFactory
      Type Parameters:
      T - the codec's value type
      Parameters:
      typeRef - the type to create a codec for
      Returns:
      a codec for the type