Package com.google.protobuf
Class UnknownFieldSchema<T,B>
- java.lang.Object
-
- com.google.protobuf.UnknownFieldSchema<T,B>
-
- Direct Known Subclasses:
UnknownFieldSetLiteSchema,UnknownFieldSetSchema
@ExperimentalApi @CheckReturnValue abstract class UnknownFieldSchema<T,B> extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intDEFAULT_RECURSION_LIMITprivate static intrecursionLimit
-
Constructor Summary
Constructors Constructor Description UnknownFieldSchema()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract voidaddFixed32(B fields, int number, int value)Adds a fixed32 value to the unknown fields.(package private) abstract voidaddFixed64(B fields, int number, long value)Adds a fixed64 value to the unknown fields.(package private) abstract voidaddGroup(B fields, int number, T subFieldSet)Adds a group value to the unknown fields.(package private) abstract voidaddLengthDelimited(B fields, int number, ByteString value)Adds a length delimited value to the unknown fields.(package private) abstract voidaddVarint(B fields, int number, long value)Adds a varint value to the unknown fields.(package private) abstract BgetBuilderFromMessage(java.lang.Object message)Returns a builder for unknown fields in the message.(package private) abstract TgetFromMessage(java.lang.Object message)Get the unknown fields from the message.(package private) abstract intgetSerializedSize(T unknowns)(package private) abstract intgetSerializedSizeAsMessageSet(T message)Get the serialized size for message set serialization.(package private) abstract voidmakeImmutable(java.lang.Object message)Marks unknown fields as immutable.(package private) abstract Tmerge(T destination, T source)Mergessourceintodestinationand returns the merged instance.private voidmergeFrom(B unknownFields, Reader reader, int currentDepth)(package private) booleanmergeOneFieldFrom(B unknownFields, Reader reader, int currentDepth)Merges one field into the unknown fields.(package private) abstract BnewBuilder()Create a new builder for unknown fields.(package private) abstract voidsetBuilderToMessage(java.lang.Object message, B builder)Sets an unknown field builder into the message.voidsetRecursionLimit(int limit)Set the maximum recursion limit that ArrayDecoders will allow.(package private) abstract voidsetToMessage(java.lang.Object message, T fields)Sets the unknown fields into the message.(package private) abstract booleanshouldDiscardUnknownFields(Reader reader)Whether unknown fields should be dropped.(package private) abstract TtoImmutable(B fields)Returns an immutable instance of the field container.(package private) abstract voidwriteAsMessageSetTo(T unknownFields, Writer writer)(package private) abstract voidwriteTo(T unknownFields, Writer writer)
-
-
-
Field Detail
-
DEFAULT_RECURSION_LIMIT
static final int DEFAULT_RECURSION_LIMIT
- See Also:
- Constant Field Values
-
recursionLimit
private static volatile int recursionLimit
-
-
Method Detail
-
shouldDiscardUnknownFields
abstract boolean shouldDiscardUnknownFields(Reader 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.
-
setToMessage
abstract void setToMessage(java.lang.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(java.lang.Object message)
Get the unknown fields from the message.
-
getBuilderFromMessage
abstract B getBuilderFromMessage(java.lang.Object message)
Returns a builder for unknown fields in the message.
-
setBuilderToMessage
abstract void setBuilderToMessage(java.lang.Object message, B builder)Sets an unknown field builder into the message.
-
makeImmutable
abstract void makeImmutable(java.lang.Object message)
Marks unknown fields as immutable.
-
mergeOneFieldFrom
final boolean mergeOneFieldFrom(B unknownFields, Reader reader, int currentDepth) throws java.io.IOException
Merges one field into the unknown fields.- Throws:
java.io.IOException
-
mergeFrom
private final void mergeFrom(B unknownFields, Reader reader, int currentDepth) throws java.io.IOException
- Throws:
java.io.IOException
-
writeTo
abstract void writeTo(T unknownFields, Writer writer) throws java.io.IOException
- Throws:
java.io.IOException
-
writeAsMessageSetTo
abstract void writeAsMessageSetTo(T unknownFields, Writer writer) throws java.io.IOException
- Throws:
java.io.IOException
-
merge
abstract T merge(T destination, T source)
Mergessourceintodestinationand 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.
-
-