Enum Class Field.FieldType

java.lang.Object
java.lang.Enum<Field.FieldType>
com.hedera.pbj.compiler.impl.Field.FieldType
All Implemented Interfaces:
Serializable, Comparable<Field.FieldType>, Constable
Enclosing interface:
Field

public static enum Field.FieldType extends Enum<Field.FieldType>
Field type enum for use in field classes
  • Enum Constant Details

    • MESSAGE

      public static final Field.FieldType MESSAGE
      Protobuf message field type
    • ENUM

      public static final Field.FieldType ENUM
      Protobuf enum(unsigned varint encoded int of ordinal) field type
    • INT32

      public static final Field.FieldType INT32
      Protobuf int32(signed varint encoded int) field type
    • UINT32

      public static final Field.FieldType UINT32
      Protobuf uint32(unsigned varint encoded int) field type
    • SINT32

      public static final Field.FieldType SINT32
      Protobuf sint32(signed zigzag varint encoded int) field type
    • INT64

      public static final Field.FieldType INT64
      Protobuf int64(signed varint encoded long) field type
    • UINT64

      public static final Field.FieldType UINT64
      Protobuf uint64(unsigned varint encoded long) field type
    • SINT64

      public static final Field.FieldType SINT64
      Protobuf sint64(signed zigzag varint encoded long) field type
    • FLOAT

      public static final Field.FieldType FLOAT
      Protobuf float field type
    • FIXED32

      public static final Field.FieldType FIXED32
      Protobuf fixed int32(fixed encoding int) field type
    • SFIXED32

      public static final Field.FieldType SFIXED32
      Protobuf sfixed int32(signed fixed encoding int) field type
    • DOUBLE

      public static final Field.FieldType DOUBLE
      Protobuf double field type
    • FIXED64

      public static final Field.FieldType FIXED64
      Protobuf sfixed64(fixed encoding long) field type
    • SFIXED64

      public static final Field.FieldType SFIXED64
      Protobuf sfixed64(signed fixed encoding long) field type
    • STRING

      public static final Field.FieldType STRING
      Protobuf string field type
    • BOOL

      public static final Field.FieldType BOOL
      Protobuf bool(boolean) field type
    • BYTES

      public static final Field.FieldType BYTES
      Protobuf bytes field type
    • ONE_OF

      public static final Field.FieldType ONE_OF
      Protobuf oneof field type, this is not a true field type in protobuf. Needed here for a few edge cases
    • MAP

      public static final Field.FieldType MAP
  • Field Details

    • javaType

      public final String javaType
      The type of field type in Java code
    • boxedType

      public final String boxedType
      The type of boxed field type in Java code
    • javaDefault

      public final String javaDefault
      The field type default value in Java code
    • wireType

      public final int wireType
      The protobuf wire type for field type
  • Method Details

    • values

      public static Field.FieldType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Field.FieldType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fieldType

      String fieldType()
      Get the field type string = the enum name
      Returns:
      Field type string
    • wireType

      public int wireType()
      Get the protobuf wire type for field type
      Returns:
      protobuf wire type for field type
    • javaType

      public String javaType(boolean repeated)
      Get the type of field type in Java code
      Parameters:
      repeated - if the field is repeated or not, java types are different for repeated field
      Returns:
      The type of field type in Java code
    • of

      Get the field type for a given parser context
      Parameters:
      typeContext - The parser context to get field type for
      lookupHelper - Lookup helper with global context
      Returns:
      The field type enum for parser context
    • of

      Get the field type for a given map key type parser context
      Parameters:
      typeContext - The parser context to get field type for
      lookupHelper - Lookup helper with global context
      Returns:
      The field type enum for parser context