# Class UnknownFieldSet.Field (3.19.4)

    public static final class UnknownFieldSet.Field

Represents a single field in an `UnknownFieldSet`.

A `Field` consists of five lists of values. The lists correspond to the five "wire
types" used in the protocol buffer binary format. The wire type of each field can be determined
from the encoded form alone, without knowing the field's declared type. So, we are able to
parse unknown values at least this far and separate them. Normally, only one of the five lists
will contain any values, since it is impossible to define a valid message type that declares
two different types for the same field number. However, the code is designed to allow for the
case where the same unknown field number is encountered using multiple different wire types.

`Field` is an immutable class. To construct one, you must use a Builder.
**See Also:** [UnknownFieldSet](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.UnknownFieldSet)

## Inheritance

[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> UnknownFieldSet.Field

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Methods

### getDefaultInstance()

    public static UnknownFieldSet.Field getDefaultInstance()

Get an empty `Field`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.UnknownFieldSet.Field` |   |

### newBuilder()

    public static UnknownFieldSet.Field.Builder newBuilder()

Construct a new Builder.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.UnknownFieldSet.Field.Builder` |   |

### newBuilder(UnknownFieldSet.Field copyFrom)

    public static UnknownFieldSet.Field.Builder newBuilder(UnknownFieldSet.Field copyFrom)

Construct a new Builder and initialize it to a copy of `copyFrom`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `copyFrom` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.UnknownFieldSet.Field` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.UnknownFieldSet.Field.Builder` |   |

## Methods

### equals(Object other)

    public boolean equals(Object other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)

### getFixed32List()

    public List<Integer> getFixed32List()

Get the list of fixed32 values for this field.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html>` |   |

### getFixed64List()

    public List<Long> getFixed64List()

Get the list of fixed64 values for this field.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html>` |   |

### getGroupList()

    public List<UnknownFieldSet> getGroupList()

Get the list of embedded group values for this field. These are represented using [UnknownFieldSet](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.UnknownFieldSet)s rather than [Message](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Message)s since the group's type is presumably unknown.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.UnknownFieldSet>` |   |

### getLengthDelimitedList()

    public List<ByteString> getLengthDelimitedList()

Get the list of length-delimited values for this field.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString>` |   |

### getSerializedSize(int fieldNumber)

    public int getSerializedSize(int fieldNumber)

Get the number of bytes required to encode this field, including field number.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `fieldNumber` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getSerializedSizeAsMessageSetExtension(int fieldNumber)

    public int getSerializedSizeAsMessageSetExtension(int fieldNumber)

Get the number of bytes required to encode this field, including field number, using `
MessageSet` wire format.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `fieldNumber` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getVarintList()

    public List<Long> getVarintList()

Get the list of varint values for this field.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html>` |   |

### hashCode()

    public int hashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)

### toByteString(int fieldNumber)

    public ByteString toByteString(int fieldNumber)

Serializes the message to a `ByteString` and returns it. This is just a trivial wrapper
around [#writeTo(int, CodedOutputStream)](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.UnknownFieldSet.Field#com_google_protobuf_UnknownFieldSet_Field_writeTo_int_com_google_protobuf_CodedOutputStream_).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `fieldNumber` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString` |   |

### writeAsMessageSetExtensionTo(int fieldNumber, CodedOutputStream output)

    public void writeAsMessageSetExtensionTo(int fieldNumber, CodedOutputStream output)

Serializes the field, including field number, and writes it to `output`, using `
MessageSet` wire format.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `fieldNumber` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `output` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.CodedOutputStream` |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### writeTo(int fieldNumber, CodedOutputStream output)

    public void writeTo(int fieldNumber, CodedOutputStream output)

Serializes the field, including field number, and writes it to `output`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `fieldNumber` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `output` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.CodedOutputStream` |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |