public class TableEntity extends Object
TableEntity can be used directly when interacting with the Tables service, with methods on the
TableClient and TableAsyncClient classes that accept and
return TableEntity instances. After creating an instance, call the TableEntity.addProperty(String, Object) or
TableEntity.addProperties(Map) methods to add properties to the entity. When retrieving an entity from the service, call
the TableEntity.getProperty(String) or TableEntity.getProperties() methods to access the entity's properties.
As an alternative, developers can also create a subclass of TableEntity and add property getters and setters
to it. If the properties' types are compatible with the Table service, they will automatically be included in any
write operations, and will automatically be populated in any read operations. Any properties that expose enum types
will be converted to string values for write operations, and will be converted back into enum values for read
operations. See Property Types
for more information about data types supported by the Tables service.| Constructor and Description |
|---|
TableEntity(String partitionKey,
String rowKey)
Construct a new
TableEntity. |
| Modifier and Type | Method and Description |
|---|---|
TableEntity |
addProperties(Map<String,Object> properties)
Adds the contents of the provided map to the entity's properties map.
|
TableEntity |
addProperty(String key,
Object value)
Adds a single property to the entity's properties map.
|
String |
getETag()
Gets the entity's eTag.
|
String |
getPartitionKey()
Gets the entity's partition key.
|
Map<String,Object> |
getProperties()
Gets the map of the entity's properties.
|
Object |
getProperty(String key)
Gets a single property from the entity's properties map.
|
String |
getRowKey()
Gets the entity's row key.
|
OffsetDateTime |
getTimestamp()
Gets the entity's timestamp.
|
public final Object getProperty(String key)
TableEntity.addProperty(String, Object) or
TableEntity.addProperties(Map) will be returned from this method. Calling this method on a subclass of
TableEntity will not retrieve a property which is being supplied via a getter method on the subclass.key - Key for the property.NullPointerException - if key is null.public final Map<String,Object> getProperties()
TableEntity.addProperty(String, Object) or
TableEntity.addProperties(Map) will be returned from this method. Calling this method on a subclass of
TableEntity will not retrieve properties which are being supplied via a getter methods on the subclass.public final TableEntity addProperty(String key, Object value)
key - Key for the property.value - Value of the property.TableEntity.NullPointerException - if key is null.public final TableEntity addProperties(Map<String,Object> properties)
properties - The map of properties to add.TableEntity.NullPointerException - if properties is null.public final String getRowKey()
public final String getPartitionKey()
public final OffsetDateTime getTimestamp()
TableEntity instances will not have a
timestamp, but a timestamp will be present on any TableEntity returned from the service.public final String getETag()
TableEntity instances will not have an eTag, but
an eTag will be present on any TableEntity returned from the service.Copyright © 2021 Microsoft Corporation. All rights reserved.