Class UnknownFieldSchema<T,B>

java.lang.Object
com.google.protobuf.UnknownFieldSchema<T,B>
Direct Known Subclasses:
UnknownFieldSetLiteSchema

@ExperimentalApi @CheckReturnValue abstract class UnknownFieldSchema<T,B> extends Object
  • Field Details

    • DEFAULT_RECURSION_LIMIT

      static final int DEFAULT_RECURSION_LIMIT
      See Also:
    • recursionLimit

      private static volatile int recursionLimit
  • Constructor Details

    • UnknownFieldSchema

      UnknownFieldSchema()
  • Method Details

    • shouldDiscardUnknownFields

      abstract boolean shouldDiscardUnknownFields(CodedInputStreamReader reader)
      Whether unknown fields should be dropped.
    • addVarint

      abstract void addVarint(B fields, int number, long value)
      Adds a varint value to the unknown fields.
    • addFixed32

      abstract void addFixed32(B fields, int number, int value)
      Adds a fixed32 value to the unknown fields.
    • addFixed64

      abstract void addFixed64(B fields, int number, long value)
      Adds a fixed64 value to the unknown fields.
    • addLengthDelimited

      abstract void addLengthDelimited(B fields, int number, ByteString value)
      Adds a length delimited value to the unknown fields.
    • addGroup

      abstract void addGroup(B fields, int number, T subFieldSet)
      Adds a group value to the unknown fields.
    • newBuilder

      abstract B newBuilder()
      Create a new builder for unknown fields.
    • toImmutable

      abstract T toImmutable(B fields)
      Returns an immutable instance of the field container.
    • setToMessage

      abstract void setToMessage(Object message, T fields)
      Sets the unknown fields into the message. Caller must take care of the mutability of the fields.
    • getFromMessage

      abstract T getFromMessage(Object message)
      Get the unknown fields from the message.
    • getBuilderFromMessage

      abstract B getBuilderFromMessage(Object message)
      Returns a builder for unknown fields in the message.
    • setBuilderToMessage

      abstract void setBuilderToMessage(Object message, B builder)
      Sets an unknown field builder into the message.
    • makeImmutable

      abstract void makeImmutable(Object message)
      Marks unknown fields as immutable.
    • mergeOneFieldFrom

      final boolean mergeOneFieldFrom(B unknownFields, CodedInputStreamReader reader, int currentDepth) throws IOException
      Merges one field into the unknown fields.
      Throws:
      IOException
    • mergeFrom

      private final void mergeFrom(B unknownFields, CodedInputStreamReader reader, int currentDepth) throws IOException
      Throws:
      IOException
    • writeTo

      abstract void writeTo(T unknownFields, CodedOutputStreamWriter writer) throws IOException
      Throws:
      IOException
    • writeAsMessageSetTo

      abstract void writeAsMessageSetTo(T unknownFields, CodedOutputStreamWriter writer) throws IOException
      Throws:
      IOException
    • merge

      abstract T merge(T destination, T source)
      Merges source into destination and returns the merged instance.
    • getSerializedSizeAsMessageSet

      abstract int getSerializedSizeAsMessageSet(T message)
      Get the serialized size for message set serialization.
    • getSerializedSize

      abstract int getSerializedSize(T unknowns)
    • setRecursionLimit

      public void setRecursionLimit(int limit)
      Set the maximum recursion limit that ArrayDecoders will allow. An exception will be thrown if the depth of the message exceeds this limit.