Top Fields Constructors Methods
com.fasterxml.jackson.dataformat.protobuf.schema

public Class ProtobufField

extends Object
implements Comparable<ProtobufField>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Imports
java.util.*, com.fasterxml.jackson.core.SerializableString, com.squareup.protoparser.FieldElement, .OptionElement

Field Summary

Modifier and TypeField and Description
public final boolean
protected final EnumLookup
enumValues

For fields of type FieldType#ENUM, mapping from names to ids.

public final int
id

Numeric tag, unshifted

public final boolean
public final boolean
protected ProtobufMessage
messageType

For main type of FieldType#MESSAGE, reference to actual message type definition.

public final String
name

Name of field in protoc definition

public ProtobufField
next

Link to next field within message definition; used for efficient traversal.

public final boolean
public final boolean
public final boolean
public final FieldType
public final int
typedTag

Combination of numeric tag and 3-bit wire type.

public final boolean
public final int
wireType

3-bit id used on determining details of how values are serialized.

Constructor Summary

AccessConstructor and Description
public
public
public
protected

Method Summary

Modifier and TypeMethod and Description
private static boolean
public void
public void
public int
compareTo(ProtobufField
the object to be compared.
other
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public final String
findEnumByIndex(int index)

public final int
public final int
public Collection<String>
public final ProtobufMessage
public final boolean
public final boolean
isValidFor(int typeTag)

public final ProtobufField
nextIf(String nameToMatch)

public final ProtobufField
nextOrThisIf(int idToMatch)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public static ProtobufField
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

deprecatedback to summary
public final boolean deprecated
enumValuesback to summary
protected final EnumLookup enumValues

For fields of type FieldType#ENUM, mapping from names to ids.

idback to summary
public final int id

Numeric tag, unshifted

isObjectback to summary
public final boolean isObject
isStdEnumback to summary
public final boolean isStdEnum
messageTypeback to summary
protected ProtobufMessage messageType

For main type of FieldType#MESSAGE, reference to actual message type definition.

nameback to summary
public final String name

Name of field in protoc definition

nextback to summary
public ProtobufField next

Link to next field within message definition; used for efficient traversal. Due to inverse construction order need to be assigned after construction; but functionally immutable.

packedback to summary
public final boolean packed
repeatedback to summary
public final boolean repeated
requiredback to summary
public final boolean required
typeback to summary
public final FieldType type
typedTagback to summary
public final int typedTag

Combination of numeric tag and 3-bit wire type.

usesZigZagback to summary
public final boolean usesZigZag
wireTypeback to summary
public final int wireType

3-bit id used on determining details of how values are serialized.

Constructor Detail

ProtobufFieldback to summary
public ProtobufField(FieldElement nativeField, FieldType type)
ProtobufFieldback to summary
public ProtobufField(FieldElement nativeField, ProtobufMessage msg)
ProtobufFieldback to summary
public ProtobufField(FieldElement nativeField, ProtobufEnum et)
ProtobufFieldback to summary
protected ProtobufField(FieldElement nativeField, FieldType type, ProtobufMessage msg, ProtobufEnum et)

Method Detail

_findBooleanOptionback to summary
private static boolean _findBooleanOption(FieldElement f, String key)
assignMessageTypeback to summary
public void assignMessageType(ProtobufMessage msgType)
assignNextback to summary
public void assignNext(ProtobufField n)
compareToback to summary
public int compareTo(ProtobufField other)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
other:ProtobufField

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
findEnumByIndexback to summary
public final String findEnumByIndex(int index)
findEnumIndexback to summary
public final int findEnumIndex(SerializableString key)
findEnumIndexback to summary
public final int findEnumIndex(String key)
getEnumValuesback to summary
public Collection<String> getEnumValues()
getMessageTypeback to summary
public final ProtobufMessage getMessageType()
isArrayback to summary
public final boolean isArray()
isValidForback to summary
public final boolean isValidFor(int typeTag)
nextIfback to summary
public final ProtobufField nextIf(String nameToMatch)
nextOrThisIfback to summary
public final ProtobufField nextOrThisIf(int idToMatch)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
unknownFieldback to summary
public static ProtobufField unknownField()