Package com.google.protobuf

# Enum Class FieldType

java.lang.Object
java.lang.Enum<FieldType>
com.google.protobuf.FieldType

All Implemented Interfaces:
  `Serializable`, `Comparable<FieldType>`, `Constable`

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

## Nested Class Summary

## Nested classes/interfaces inherited from class java.lang.Enum

`Enum.EnumDesc<E extends Enum<E>>`

## Enum Constant Summary

Enum Constants
Enum Constant
Description
`BOOL`
`BOOL_LIST`
`BOOL_LIST_PACKED`
`BYTES`
`BYTES_LIST`
`DOUBLE`
`DOUBLE_LIST`
`DOUBLE_LIST_PACKED`
`ENUM`
`ENUM_LIST`
`ENUM_LIST_PACKED`
`FIXED32`
`FIXED32_LIST`
`FIXED32_LIST_PACKED`
`FIXED64`
`FIXED64_LIST`
`FIXED64_LIST_PACKED`
`FLOAT`
`FLOAT_LIST`
`FLOAT_LIST_PACKED`
`GROUP`
`GROUP_LIST`
`INT32`
`INT32_LIST`
`INT32_LIST_PACKED`
`INT64`
`INT64_LIST`
`INT64_LIST_PACKED`
`MAP`
`MESSAGE`
`MESSAGE_LIST`
`SFIXED32`
`SFIXED32_LIST`
`SFIXED32_LIST_PACKED`
`SFIXED64`
`SFIXED64_LIST`
`SFIXED64_LIST_PACKED`
`SINT32`
`SINT32_LIST`
`SINT32_LIST_PACKED`
`SINT64`
`SINT64_LIST`
`SINT64_LIST_PACKED`
`STRING`
`STRING_LIST`
`UINT32`
`UINT32_LIST`
`UINT32_LIST_PACKED`
`UINT64`
`UINT64_LIST`
`UINT64_LIST_PACKED`

## Method Summary

Modifier and Type
Method
Description
`static FieldType`
`forId(int id)`
Looks up the appropriate `FieldType` by it's identifier.
`JavaType`
`getJavaType()`
Gets the `JavaType` for this field.
`int`
`id()`
A reliable unique identifier for this type.
`boolean`
`isList()`
Indicates whether this field represents a list of values.
`boolean`
`isMap()`
Indicates whether this field represents a map.
`boolean`
`isPacked()`
Indicates whether a list field should be represented on the wire in packed form.
`boolean`
`isPrimitiveScalar()`
Indicates whether this field type represents a primitive scalar value.
`boolean`
`isScalar()`
Indicates whether this field type represents a scalar value.
`boolean`
`isValidForField(Field field)`
Indicates whether or not this `FieldType` can be applied to the given `Field`.
`static FieldType`
`valueOf(String name)`
Returns the enum constant of this class with the specified name.
`static FieldType[]`
`values()`
Returns an array containing the constants of this enum class, in the order they are declared.

### Methods inherited from class java.lang.Enum

`clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

`getClass, notify, notifyAll, wait, wait, wait`

## Enum Constant Details

### DOUBLE

public static final FieldType DOUBLE

### FLOAT

public static final FieldType FLOAT

### INT64

public static final FieldType INT64

### UINT64

public static final FieldType UINT64

### INT32

public static final FieldType INT32

### FIXED64

public static final FieldType FIXED64

### FIXED32

public static final FieldType FIXED32

### BOOL

public static final FieldType BOOL

### STRING

public static final FieldType STRING

### MESSAGE

public static final FieldType MESSAGE

### BYTES

public static final FieldType BYTES

### UINT32

public static final FieldType UINT32

### ENUM

public static final FieldType ENUM

### SFIXED32

public static final FieldType SFIXED32

### SFIXED64

public static final FieldType SFIXED64

### SINT32

public static final FieldType SINT32

### SINT64

public static final FieldType SINT64

### GROUP

public static final FieldType GROUP

### 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

### MAP

public static final FieldType MAP

## Method Details

### values

public static 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 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

### 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(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.