Enum FieldType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<FieldType>

    @ExperimentalApi
    public enum FieldType
    extends java.lang.Enum<FieldType>
    Enumeration identifying all relevant type information for a protobuf field.
    • Enum Constant Detail

      • DOUBLE

        public static final FieldType DOUBLE
      • UINT64

        public static final FieldType UINT64
      • FIXED64

        public static final FieldType FIXED64
      • FIXED32

        public static final FieldType FIXED32
      • STRING

        public static final FieldType STRING
      • MESSAGE

        public static final FieldType MESSAGE
      • UINT32

        public static final FieldType UINT32
      • SFIXED32

        public static final FieldType SFIXED32
      • SFIXED64

        public static final FieldType SFIXED64
      • SINT32

        public static final FieldType SINT32
      • SINT64

        public static final FieldType SINT64
      • DOUBLE_LIST

        public static final FieldType DOUBLE_LIST
      • FLOAT_LIST

        public static final FieldType FLOAT_LIST
      • INT64_LIST

        public static final FieldType INT64_LIST
      • UINT64_LIST

        public static final FieldType UINT64_LIST
      • INT32_LIST

        public static final FieldType INT32_LIST
      • FIXED64_LIST

        public static final FieldType FIXED64_LIST
      • FIXED32_LIST

        public static final FieldType FIXED32_LIST
      • BOOL_LIST

        public static final FieldType BOOL_LIST
      • STRING_LIST

        public static final FieldType STRING_LIST
      • MESSAGE_LIST

        public static final FieldType MESSAGE_LIST
      • BYTES_LIST

        public static final FieldType BYTES_LIST
      • UINT32_LIST

        public static final FieldType UINT32_LIST
      • ENUM_LIST

        public static final FieldType ENUM_LIST
      • SFIXED32_LIST

        public static final FieldType SFIXED32_LIST
      • SFIXED64_LIST

        public static final FieldType SFIXED64_LIST
      • SINT32_LIST

        public static final FieldType SINT32_LIST
      • SINT64_LIST

        public static final FieldType SINT64_LIST
      • DOUBLE_LIST_PACKED

        public static final FieldType DOUBLE_LIST_PACKED
      • FLOAT_LIST_PACKED

        public static final FieldType FLOAT_LIST_PACKED
      • INT64_LIST_PACKED

        public static final FieldType INT64_LIST_PACKED
      • UINT64_LIST_PACKED

        public static final FieldType UINT64_LIST_PACKED
      • INT32_LIST_PACKED

        public static final FieldType INT32_LIST_PACKED
      • FIXED64_LIST_PACKED

        public static final FieldType FIXED64_LIST_PACKED
      • FIXED32_LIST_PACKED

        public static final FieldType FIXED32_LIST_PACKED
      • BOOL_LIST_PACKED

        public static final FieldType BOOL_LIST_PACKED
      • UINT32_LIST_PACKED

        public static final FieldType UINT32_LIST_PACKED
      • ENUM_LIST_PACKED

        public static final FieldType ENUM_LIST_PACKED
      • SFIXED32_LIST_PACKED

        public static final FieldType SFIXED32_LIST_PACKED
      • SFIXED64_LIST_PACKED

        public static final FieldType SFIXED64_LIST_PACKED
      • SINT32_LIST_PACKED

        public static final FieldType SINT32_LIST_PACKED
      • SINT64_LIST_PACKED

        public static final FieldType SINT64_LIST_PACKED
      • GROUP_LIST

        public static final FieldType GROUP_LIST
    • Method Detail

      • values

        public static FieldType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (FieldType c : FieldType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static FieldType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • id

        public int id()
        A reliable unique identifier for this type.
      • getJavaType

        public JavaType getJavaType()
        Gets the JavaType for this field. For lists, this identifies the type of the elements contained within the list.
      • isPacked

        public boolean isPacked()
        Indicates whether a list field should be represented on the wire in packed form.
      • isPrimitiveScalar

        public boolean isPrimitiveScalar()
        Indicates whether this field type represents a primitive scalar value. If this is true, then isScalar() will also be true.
      • isScalar

        public boolean isScalar()
        Indicates whether this field type represents a scalar value.
      • isList

        public boolean isList()
        Indicates whether this field represents a list of values.
      • isMap

        public boolean isMap()
        Indicates whether this field represents a map.
      • isValidForField

        public boolean isValidForField​(java.lang.reflect.Field field)
        Indicates whether or not this FieldType can be applied to the given Field.
      • forId

        public static FieldType forId​(int id)
        Looks up the appropriate FieldType by it's identifier.
        Returns:
        the FieldType or null if not found.