com.fasterxml.jackson.dataformat.protobuf.schema

## Class ProtobufField

- java.lang.Object
- - com.fasterxml.jackson.dataformat.protobuf.schema.ProtobufField

- All Implemented Interfaces:
    Comparable<ProtobufField>

      public class ProtobufField
      extends Object
      implements Comparable<ProtobufField>

- - ### Field Summary

    Fields
    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.

  - ### Constructor Summary

    Constructors
    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)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### id

          public final int id

      Numeric tag, unshifted

    - #### typedTag

          public final int typedTag

      Combination of numeric tag and 3-bit wire type.

    - #### name

          public final String name

      Name of field in protoc definition

    - #### type

          public final FieldType type

    - #### wireType

          public final int wireType

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

    - #### required

          public final boolean required

    - #### repeated

          public final boolean repeated

    - #### packed

          public final boolean packed

    - #### deprecated

          public final boolean deprecated

    - #### usesZigZag

          public final boolean usesZigZag

    - #### messageType

          protected ProtobufMessage messageType

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

    - #### enumValues

          protected final EnumLookup enumValues

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

    - #### next

          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.

    - #### isObject

          public final boolean isObject

    - #### isStdEnum

          public final boolean isStdEnum

  - ### Constructor Detail

    - #### ProtobufField

          public ProtobufField(com.squareup.protoparser.FieldElement nativeField,
                               FieldType type)

    - #### ProtobufField

          public ProtobufField(com.squareup.protoparser.FieldElement nativeField,
                               ProtobufMessage msg)

    - #### ProtobufField

          public ProtobufField(com.squareup.protoparser.FieldElement nativeField,
                               ProtobufEnum et)

    - #### ProtobufField

          protected ProtobufField(com.squareup.protoparser.FieldElement nativeField,
                                  FieldType type,
                                  ProtobufMessage msg,
                                  ProtobufEnum et)

  - ### Method Detail

    - #### unknownField

          public static ProtobufField unknownField()

    - #### assignMessageType

          public void assignMessageType(ProtobufMessage msgType)

    - #### assignNext

          public void assignNext(ProtobufField n)

    - #### getMessageType

          public final ProtobufMessage getMessageType()

    - #### nextOrThisIf

          public final ProtobufField nextOrThisIf(int idToMatch)

    - #### nextIf

          public final ProtobufField nextIf(String nameToMatch)

    - #### findEnumIndex

          public final int findEnumIndex(com.fasterxml.jackson.core.SerializableString key)

    - #### findEnumIndex

          public final int findEnumIndex(String key)

    - #### findEnumByIndex

          public final String findEnumByIndex(int index)

    - #### getEnumValues

          public Collection<String> getEnumValues()

    - #### isArray

          public final boolean isArray()

    - #### isValidFor

          public final boolean isValidFor(int typeTag)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### compareTo

          public int compareTo(ProtobufField other)

      Specified by:
        `compareTo` in interface `Comparable<ProtobufField>`

Copyright © 2019 FasterXML. All rights reserved.