Class ProtoDomain

  • All Implemented Interfaces:
    java.io.Serializable

    public final class ProtoDomain
    extends java.lang.Object
    implements java.io.Serializable
    ProtoDomain is a container class for Protobuf descriptors. By using a domain for all descriptors that are related to each other the FileDescriptorSet needs to be serialized only once in the graph.

    Using a domain also grantees that all Descriptors have object equality, just like statically compiled Proto classes Descriptors. A lot of Java code isn't used to the new DynamicMessages an assume always Object equality. Because of this the domain class is immutable.

    ProtoDomains aren't assumed to be used on with normal Message descriptors, only with DynamicMessage descriptors.

    See Also:
    Serialized Form
    • Field Summary

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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ProtoDomain buildFrom​(com.google.protobuf.DescriptorProtos.FileDescriptorSet fileDescriptorSet)  
      static ProtoDomain buildFrom​(com.google.protobuf.Descriptors.Descriptor descriptor)  
      static ProtoDomain buildFrom​(com.google.protobuf.Descriptors.FileDescriptor fileDescriptor)  
      static ProtoDomain buildFrom​(java.io.InputStream inputStream)  
      boolean contains​(com.google.protobuf.Descriptors.Descriptor descriptor)  
      boolean equals​(@Nullable java.lang.Object o)  
      com.google.protobuf.Descriptors.Descriptor getDescriptor​(java.lang.String fullName)  
      com.google.protobuf.Descriptors.FieldDescriptor getFieldOptionById​(int id)  
      com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor​(java.lang.String name)  
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • buildFrom

        public static ProtoDomain buildFrom​(com.google.protobuf.Descriptors.Descriptor descriptor)
      • buildFrom

        public static ProtoDomain buildFrom​(com.google.protobuf.DescriptorProtos.FileDescriptorSet fileDescriptorSet)
      • buildFrom

        public static ProtoDomain buildFrom​(com.google.protobuf.Descriptors.FileDescriptor fileDescriptor)
      • buildFrom

        public static ProtoDomain buildFrom​(java.io.InputStream inputStream)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getFileDescriptor

        public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor​(java.lang.String name)
      • getDescriptor

        public com.google.protobuf.Descriptors.Descriptor getDescriptor​(java.lang.String fullName)
      • getFieldOptionById

        public com.google.protobuf.Descriptors.FieldDescriptor getFieldOptionById​(int id)
      • equals

        public boolean equals​(@Nullable java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • contains

        public boolean contains​(com.google.protobuf.Descriptors.Descriptor descriptor)