public class ProtobufField extends Object implements Comparable<ProtobufField>
Modifier and Type | Field and Description |
---|---|
boolean |
deprecated |
protected EnumLookup |
enumValues
For fields of type
FieldType.ENUM , mapping from names to ids. |
int |
id
Numeric tag, unshifted
|
boolean |
isObject |
boolean |
isStdEnum |
protected ProtobufMessage |
messageType
For main type of
FieldType.MESSAGE , reference to actual
message type definition. |
String |
name
Name of field in protoc definition
|
ProtobufField |
next
Link to next field within message definition; used for efficient traversal.
|
boolean |
packed |
boolean |
repeated |
boolean |
required |
FieldType |
type |
int |
typedTag
Combination of numeric tag and 3-bit wire type.
|
boolean |
usesZigZag |
int |
wireType
3-bit id used on determining details of how values are serialized.
|
Modifier | Constructor and Description |
---|---|
|
ProtobufField(com.squareup.protoparser.FieldElement nativeField,
FieldType type) |
protected |
ProtobufField(com.squareup.protoparser.FieldElement nativeField,
FieldType type,
ProtobufMessage msg,
ProtobufEnum et) |
|
ProtobufField(com.squareup.protoparser.FieldElement nativeField,
ProtobufEnum et) |
|
ProtobufField(com.squareup.protoparser.FieldElement nativeField,
ProtobufMessage msg) |
Modifier and Type | Method and Description |
---|---|
void |
assignMessageType(ProtobufMessage msgType) |
void |
assignNext(ProtobufField n) |
int |
compareTo(ProtobufField other) |
String |
findEnumByIndex(int index) |
int |
findEnumIndex(com.fasterxml.jackson.core.SerializableString key) |
int |
findEnumIndex(String key) |
Collection<String> |
getEnumValues() |
ProtobufMessage |
getMessageType() |
boolean |
isArray() |
boolean |
isValidFor(int typeTag) |
ProtobufField |
nextIf(String nameToMatch) |
ProtobufField |
nextOrThisIf(int idToMatch) |
String |
toString() |
static ProtobufField |
unknownField() |
public final int id
public final int typedTag
public final String name
public final FieldType type
public final int wireType
public final boolean required
public final boolean repeated
public final boolean packed
public final boolean deprecated
public final boolean usesZigZag
protected ProtobufMessage messageType
FieldType.MESSAGE
, reference to actual
message type definition.protected final EnumLookup enumValues
FieldType.ENUM
, mapping from names to ids.public ProtobufField next
public final boolean isObject
public final boolean isStdEnum
public ProtobufField(com.squareup.protoparser.FieldElement nativeField, FieldType type)
public ProtobufField(com.squareup.protoparser.FieldElement nativeField, ProtobufMessage msg)
public ProtobufField(com.squareup.protoparser.FieldElement nativeField, ProtobufEnum et)
protected ProtobufField(com.squareup.protoparser.FieldElement nativeField, FieldType type, ProtobufMessage msg, ProtobufEnum et)
public static ProtobufField unknownField()
public void assignMessageType(ProtobufMessage msgType)
public void assignNext(ProtobufField n)
public final ProtobufMessage getMessageType()
public final ProtobufField nextOrThisIf(int idToMatch)
public final ProtobufField nextIf(String nameToMatch)
public final int findEnumIndex(com.fasterxml.jackson.core.SerializableString key)
public final int findEnumIndex(String key)
public final String findEnumByIndex(int index)
public Collection<String> getEnumValues()
public final boolean isArray()
public final boolean isValidFor(int typeTag)
public int compareTo(ProtobufField other)
compareTo
in interface Comparable<ProtobufField>
Copyright © 2020 FasterXML. All rights reserved.