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 int
DEFAULT_RECURSION_LIMIT
private static int
recursionLimit
-
Constructor Summary
Constructors Constructor Description UnknownFieldSchema()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract void
addFixed32(B fields, int number, int value)
Adds a fixed32 value to the unknown fields.(package private) abstract void
addFixed64(B fields, int number, long value)
Adds a fixed64 value to the unknown fields.(package private) abstract void
addGroup(B fields, int number, T subFieldSet)
Adds a group value to the unknown fields.(package private) abstract void
addLengthDelimited(B fields, int number, ByteString value)
Adds a length delimited value to the unknown fields.(package private) abstract void
addVarint(B fields, int number, long value)
Adds a varint value to the unknown fields.(package private) abstract B
getBuilderFromMessage(java.lang.Object message)
Returns a builder for unknown fields in the message.(package private) abstract T
getFromMessage(java.lang.Object message)
Get the unknown fields from the message.(package private) abstract int
getSerializedSize(T unknowns)
(package private) abstract int
getSerializedSizeAsMessageSet(T message)
Get the serialized size for message set serialization.(package private) abstract void
makeImmutable(java.lang.Object message)
Marks unknown fields as immutable.(package private) abstract T
merge(T destination, T source)
Mergessource
intodestination
and returns the merged instance.private void
mergeFrom(B unknownFields, Reader reader, int currentDepth)
(package private) boolean
mergeOneFieldFrom(B unknownFields, Reader reader, int currentDepth)
Merges one field into the unknown fields.(package private) abstract B
newBuilder()
Create a new builder for unknown fields.(package private) abstract void
setBuilderToMessage(java.lang.Object message, B builder)
Sets an unknown field builder into the message.void
setRecursionLimit(int limit)
Set the maximum recursion limit that ArrayDecoders will allow.(package private) abstract void
setToMessage(java.lang.Object message, T fields)
Sets the unknown fields into the message.(package private) abstract boolean
shouldDiscardUnknownFields(Reader reader)
Whether unknown fields should be dropped.(package private) abstract T
toImmutable(B fields)
Returns an immutable instance of the field container.(package private) abstract void
writeAsMessageSetTo(T unknownFields, Writer writer)
(package private) abstract void
writeTo(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)
Mergessource
intodestination
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.
-
-