# Class EntityTranslator (5.0.3)

    public class EntityTranslator

`EntityTranslator` contains the logic to translate an `Entity` into the protocol
buffers that are used to pass it to the implementation of the API.

## Inheritance

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

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

### convertToPb(Entity entity)

    public static OnestoreEntity.EntityProto convertToPb(Entity entity)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `entity` | `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Entity` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.storage.onestore.v3_bytes.proto2api.OnestoreEntity.EntityProto` |   |

### createFromPb(OnestoreEntity.EntityProto proto)

    public static Entity createFromPb(OnestoreEntity.EntityProto proto)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `proto` | `com.google.storage.onestore.v3_bytes.proto2api.OnestoreEntity.EntityProto` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Entity` |   |

### createFromPb(OnestoreEntity.EntityProto proto, Collection\<Projection\> projections)

    public static Entity createFromPb(OnestoreEntity.EntityProto proto, Collection<Projection> projections)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `proto` | `com.google.storage.onestore.v3_bytes.proto2api.OnestoreEntity.EntityProto` |
| `projections` | `https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html<https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Projection>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Entity` |   |

### createFromPbBytes(byte\[\] pbBytes)

    public static Entity createFromPbBytes(byte[] pbBytes)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `pbBytes` | `byte[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Entity` |   |