# Class Descriptors.OneofDescriptor (3.19.4)

    public static final class Descriptors.OneofDescriptor extends Descriptors.GenericDescriptor

Describes an oneof of a message type.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [Descriptors.GenericDescriptor](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.GenericDescriptor) \> Descriptors.OneofDescriptor

## Inherited Members

[Descriptors.GenericDescriptor.getFile()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.GenericDescriptor#com_google_protobuf_Descriptors_GenericDescriptor_getFile__) [Descriptors.GenericDescriptor.getFullName()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.GenericDescriptor#com_google_protobuf_Descriptors_GenericDescriptor_getFullName__) [Descriptors.GenericDescriptor.getName()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.GenericDescriptor#com_google_protobuf_Descriptors_GenericDescriptor_getName__) [Descriptors.GenericDescriptor.toProto()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.GenericDescriptor#com_google_protobuf_Descriptors_GenericDescriptor_toProto__) [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-)

## Methods

### getContainingType()

    public Descriptors.Descriptor getContainingType()

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

### getField(int index)

    public Descriptors.FieldDescriptor getField(int index)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `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.Descriptors.FieldDescriptor` |   |

### getFieldCount()

    public int getFieldCount()

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

### getFields()

    public List<Descriptors.FieldDescriptor> getFields()

Get a list of this message type's fields.

| **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.Descriptors.FieldDescriptor>` |   |

### getFile()

    public Descriptors.FileDescriptor getFile()

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

**Overrides** [Descriptors.GenericDescriptor.getFile()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.GenericDescriptor#com_google_protobuf_Descriptors_GenericDescriptor_getFile__)

### getFullName()

    public String getFullName()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

**Overrides** [Descriptors.GenericDescriptor.getFullName()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.GenericDescriptor#com_google_protobuf_Descriptors_GenericDescriptor_getFullName__)

### getIndex()

    public int getIndex()

Get the index of this descriptor within its parent.

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

### getName()

    public String getName()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

**Overrides** [Descriptors.GenericDescriptor.getName()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.GenericDescriptor#com_google_protobuf_Descriptors_GenericDescriptor_getName__)

### getOptions()

    public DescriptorProtos.OneofOptions getOptions()

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

### isSynthetic()

    public boolean isSynthetic()

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

### toProto()

    public DescriptorProtos.OneofDescriptorProto toProto()

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

**Overrides** [Descriptors.GenericDescriptor.toProto()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.GenericDescriptor#com_google_protobuf_Descriptors_GenericDescriptor_toProto__)