# Interface Key.PathElementOrBuilder (3.1.0)

3.1.0 (latest) 2.40.0 2.37.0 2.36.0 2.34.0 2.33.3 2.32.3 2.31.4 2.30.0 2.29.1 2.28.2 2.27.1 2.26.4 2.25.2 2.24.3 2.23.0 2.22.0 2.21.3 2.20.2 2.19.2 2.18.5 2.17.6

    public static interface Key.PathElementOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getId()

    public abstract long getId()

The auto-allocated ID of the entity.

Never equal to zero. Values less than zero are discouraged and may not
be supported in the future.

`int64 id = 2;`

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

### getIdTypeCase()

    public abstract Key.PathElement.IdTypeCase getIdTypeCase()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.Key.PathElement.IdTypeCase` |   |

### getKind()

    public abstract String getKind()

The kind of the entity.

A kind matching regex `.\*` is reserved/read-only.
A kind must not contain more than 1500 bytes when UTF-8 encoded.
Cannot be `""`.

Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as `bytes\<X\>` where `<X>` is the base-64 encoding of the
bytes.

`string kind = 1;`

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

### getKindBytes()

    public abstract ByteString getKindBytes()

The kind of the entity.

A kind matching regex `.\*` is reserved/read-only.
A kind must not contain more than 1500 bytes when UTF-8 encoded.
Cannot be `""`.

Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as `bytes\<X\>` where `<X>` is the base-64 encoding of the
bytes.

`string kind = 1;`

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

### getName()

    public abstract String getName()

The name of the entity.

A name matching regex `.\*` is reserved/read-only.
A name must not be more than 1500 bytes when UTF-8 encoded.
Cannot be `""`.

Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as `bytes\<X\>` where `<X>` is the base-64 encoding of the
bytes.

`string name = 3;`

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

### getNameBytes()

    public abstract ByteString getNameBytes()

The name of the entity.

A name matching regex `.\*` is reserved/read-only.
A name must not be more than 1500 bytes when UTF-8 encoded.
Cannot be `""`.

Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as `bytes\<X\>` where `<X>` is the base-64 encoding of the
bytes.

`string name = 3;`

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

### hasId()

    public abstract boolean hasId()

The auto-allocated ID of the entity.

Never equal to zero. Values less than zero are discouraged and may not
be supported in the future.

`int64 id = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the id field is set. |

### hasName()

    public abstract boolean hasName()

The name of the entity.

A name matching regex `.\*` is reserved/read-only.
A name must not be more than 1500 bytes when UTF-8 encoded.
Cannot be `""`.

Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as `bytes\<X\>` where `<X>` is the base-64 encoding of the
bytes.

`string name = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the name field is set. |