Class DynamicProtoCoder

    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.beam.sdk.coders.Coder

        org.apache.beam.sdk.coders.Coder.Context, org.apache.beam.sdk.coders.Coder.NonDeterministicException
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long serialVersionUID  
    • Method Detail

      • of

        public static DynamicProtoCoder of​(com.google.protobuf.Descriptors.Descriptor protoMessageDescriptor)
        Returns a DynamicProtoCoder for the Protocol Buffers DynamicMessage for the given Descriptors.Descriptor.
      • of

        public static DynamicProtoCoder of​(ProtoDomain domain,
                                           com.google.protobuf.Descriptors.Descriptor protoMessageDescriptor)
        Returns a DynamicProtoCoder for the Protocol Buffers DynamicMessage for the given Descriptors.Descriptor. The message descriptor should be part of the provided ProtoDomain, this will ensure object equality within messages from the same domain.
      • of

        public static DynamicProtoCoder of​(ProtoDomain domain,
                                           java.lang.String messageName)
        Returns a DynamicProtoCoder for the Protocol Buffers DynamicMessage for the given message name in a ProtoDomain. 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 a DynamicProtoCoder like 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:
        withExtensionsFrom in class ProtoCoder<com.google.protobuf.DynamicMessage>
      • equals

        public boolean equals​(@Nullable java.lang.Object other)
        Overrides:
        equals in class ProtoCoder<com.google.protobuf.DynamicMessage>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class ProtoCoder<com.google.protobuf.DynamicMessage>
      • getParser

        protected com.google.protobuf.Parser<com.google.protobuf.DynamicMessage> getParser()
        Get the memoized Parser, possibly initializing it lazily.
        Overrides:
        getParser in class ProtoCoder<com.google.protobuf.DynamicMessage>
      • getCoderProvider

        public static org.apache.beam.sdk.coders.CoderProvider getCoderProvider()
        Returns a CoderProvider which uses the DynamicProtoCoder for proto messages.

        This method is invoked reflectively from DefaultCoder.