Class DynamicProtoCoder
- java.lang.Object
-
- org.apache.beam.sdk.coders.Coder<T>
-
- org.apache.beam.sdk.coders.CustomCoder<T>
-
- org.apache.beam.sdk.extensions.protobuf.ProtoCoder<com.google.protobuf.DynamicMessage>
-
- org.apache.beam.sdk.extensions.protobuf.DynamicProtoCoder
-
- All Implemented Interfaces:
java.io.Serializable
public class DynamicProtoCoder extends ProtoCoder<com.google.protobuf.DynamicMessage>
ACoderusing Google Protocol Buffers binary format.DynamicProtoCodersupports both Protocol Buffers syntax versions 2 and 3.To learn more about Protocol Buffers, visit: https://developers.google.com/protocol-buffers
DynamicProtoCoderis not registered in the globalCoderRegistryas the descriptor is required to create the coder.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static longserialVersionUID
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(@Nullable java.lang.Object other)static org.apache.beam.sdk.coders.CoderProvidergetCoderProvider()protected com.google.protobuf.Parser<com.google.protobuf.DynamicMessage>getParser()Get the memoizedParser, possibly initializing it lazily.inthashCode()static DynamicProtoCoderof(com.google.protobuf.Descriptors.Descriptor protoMessageDescriptor)Returns aDynamicProtoCoderfor the Protocol BuffersDynamicMessagefor the givenDescriptors.Descriptor.static DynamicProtoCoderof(ProtoDomain domain, com.google.protobuf.Descriptors.Descriptor protoMessageDescriptor)Returns aDynamicProtoCoderfor the Protocol BuffersDynamicMessagefor the givenDescriptors.Descriptor.static DynamicProtoCoderof(ProtoDomain domain, java.lang.String messageName)Returns aDynamicProtoCoderfor the Protocol BuffersDynamicMessagefor the given message name in aProtoDomain.DynamicProtoCoderwithExtensionsFrom(java.lang.Iterable<java.lang.Class<?>> moreExtensionHosts)Returns aDynamicProtoCoderlike this one, but with the extensions from the given classes registered.-
Methods inherited from class org.apache.beam.sdk.extensions.protobuf.ProtoCoder
decode, decode, encode, encode, getExtensionHosts, getExtensionRegistry, getMessageType, of, of, verifyDeterministic, withExtensionsFrom
-
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
of
public static DynamicProtoCoder of(com.google.protobuf.Descriptors.Descriptor protoMessageDescriptor)
Returns aDynamicProtoCoderfor the Protocol BuffersDynamicMessagefor the givenDescriptors.Descriptor.
-
of
public static DynamicProtoCoder of(ProtoDomain domain, com.google.protobuf.Descriptors.Descriptor protoMessageDescriptor)
Returns aDynamicProtoCoderfor the Protocol BuffersDynamicMessagefor the givenDescriptors.Descriptor. The message descriptor should be part of the providedProtoDomain, this will ensure object equality within messages from the same domain.
-
of
public static DynamicProtoCoder of(ProtoDomain domain, java.lang.String messageName)
Returns aDynamicProtoCoderfor the Protocol BuffersDynamicMessagefor the given message name in aProtoDomain. The message descriptor should be part of the provided *ProtoDomain, this will ensure object equality within messages from the same domain.
-
withExtensionsFrom
public DynamicProtoCoder withExtensionsFrom(java.lang.Iterable<java.lang.Class<?>> moreExtensionHosts)
Returns aDynamicProtoCoderlike this one, but with the extensions from the given classes registered.Each of the extension host classes must be an class automatically generated by the Protocol Buffers compiler,
protoc, that contains messages.Does not modify this object.
- Overrides:
withExtensionsFromin classProtoCoder<com.google.protobuf.DynamicMessage>
-
equals
public boolean equals(@Nullable java.lang.Object other)
- Overrides:
equalsin classProtoCoder<com.google.protobuf.DynamicMessage>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classProtoCoder<com.google.protobuf.DynamicMessage>
-
getParser
protected com.google.protobuf.Parser<com.google.protobuf.DynamicMessage> getParser()
Get the memoizedParser, possibly initializing it lazily.- Overrides:
getParserin classProtoCoder<com.google.protobuf.DynamicMessage>
-
getCoderProvider
public static org.apache.beam.sdk.coders.CoderProvider getCoderProvider()
Returns aCoderProviderwhich uses theDynamicProtoCoderforproto messages.This method is invoked reflectively from
DefaultCoder.
-
-