# Interface EntityOrBuilder (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 interface EntityOrBuilder extends MessageOrBuilder

## Implements

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

## Methods

### containsProperties(String key)

    public abstract boolean containsProperties(String key)

The entity's properties.
The map's keys are property names.
A property name matching regex `.\*` is reserved.
A reserved property name is forbidden in certain documented contexts.
The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot
be empty.

`map<string, .google.datastore.v1.Value> properties = 3;`

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

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

### getKey()

    public abstract Key getKey()

The entity's key.

An entity must have a key, unless otherwise documented (for example,
an entity in `Value.entity_value` may have no key).
An entity's kind is its key path's last element's kind,
or null if it has no key.

`.google.datastore.v1.Key key = 1;`

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

### getKeyOrBuilder()

    public abstract KeyOrBuilder getKeyOrBuilder()

The entity's key.

An entity must have a key, unless otherwise documented (for example,
an entity in `Value.entity_value` may have no key).
An entity's kind is its key path's last element's kind,
or null if it has no key.

`.google.datastore.v1.Key key = 1;`

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

### getProperties() (deprecated)

    public abstract Map<String,Value> getProperties()

Use [#getPropertiesMap()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.EntityOrBuilder#com_google_datastore_v1_EntityOrBuilder_getPropertiesMap__) instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.Value>` |   |

### getPropertiesCount()

    public abstract int getPropertiesCount()

The entity's properties.
The map's keys are property names.
A property name matching regex `.\*` is reserved.
A reserved property name is forbidden in certain documented contexts.
The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot
be empty.

`map<string, .google.datastore.v1.Value> properties = 3;`

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

### getPropertiesMap()

    public abstract Map<String,Value> getPropertiesMap()

The entity's properties.
The map's keys are property names.
A property name matching regex `.\*` is reserved.
A reserved property name is forbidden in certain documented contexts.
The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot
be empty.

`map<string, .google.datastore.v1.Value> properties = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.Value>` |   |

### getPropertiesOrDefault(String key, Value defaultValue)

    public abstract Value getPropertiesOrDefault(String key, Value defaultValue)

The entity's properties.
The map's keys are property names.
A property name matching regex `.\*` is reserved.
A reserved property name is forbidden in certain documented contexts.
The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot
be empty.

`map<string, .google.datastore.v1.Value> properties = 3;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `defaultValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.Value` |

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

### getPropertiesOrThrow(String key)

    public abstract Value getPropertiesOrThrow(String key)

The entity's properties.
The map's keys are property names.
A property name matching regex `.\*` is reserved.
A reserved property name is forbidden in certain documented contexts.
The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot
be empty.

`map<string, .google.datastore.v1.Value> properties = 3;`

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

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

### hasKey()

    public abstract boolean hasKey()

The entity's key.

An entity must have a key, unless otherwise documented (for example,
an entity in `Value.entity_value` may have no key).
An entity's kind is its key path's last element's kind,
or null if it has no key.

`.google.datastore.v1.Key key = 1;`

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