EntityProperty Class

  • java.lang.Object
    • com.microsoft.azure.storage.table.EntityProperty

public class EntityProperty

A class which represents a single typed property value in a table entity. An EntityProperty stores the data type as an EdmType. The value, which may be for object types, but not for primitive types, is serialized and stored as a .

EntityProperty provides overloaded constructors and overloads of the method for supported value types. Each overloaded constructor or method sets the EdmType and serializes the value appropriately based on the parameter type.

Use one of the Type methods to deserialize an EntityProperty as the appropriate Java type. The method will throw a ParseException or IllegalArgumentException if the EntityProperty cannot be deserialized as the Java type.

Constructor Summary

Constructor Description
EntityProperty(final boolean value)

Constructs an EntityProperty instance from a value.

EntityProperty(final Boolean value)

Constructs an EntityProperty instance from a value.

EntityProperty(final byte[] value)

Constructs an EntityProperty instance from a value.

EntityProperty(final Byte[] value)

Constructs an EntityProperty instance from a .

EntityProperty(final Date value)

Constructs an EntityProperty instance from a value.

EntityProperty(final double value)

Constructs an EntityProperty instance from a value.

EntityProperty(final Double value)

Constructs an EntityProperty instance from a value.

EntityProperty(final int value)

Constructs an EntityProperty instance from an value.

EntityProperty(final Integer value)

Constructs an EntityProperty instance from an value.

EntityProperty(final long value)

Constructs an EntityProperty instance from a value.

EntityProperty(final Long value)

Constructs an EntityProperty instance from a value.

EntityProperty(final Object value, final Class<?> type)

Reserved for internal use. Constructs an EntityProperty instance from a value and a data type, and verifies that the value can be interpreted as the specified data type.

EntityProperty(final String value)

Constructs an EntityProperty instance from a value.

EntityProperty(final String value, final Class<?> type)

Reserved for internal use. Constructs an EntityProperty instance from a value type, and verifies that the value can be interpreted as the specified data type.

EntityProperty(final String value, final EdmType edmType)

Reserved for internal use. Constructs an EntityProperty instance from a value and a data type, and verifies that the value can be interpreted as the specified data type.

EntityProperty(final UUID value)

Constructs an EntityProperty instance from a value.

Method Summary

Modifier and Type Method and Description
EdmType getEdmType()

Gets the EdmType storage data type for the EntityProperty.

boolean getIsNull()

Gets a flag indicating that the EntityProperty value is .

Class<?> getType()

Gets the class type of the EntityProperty.

boolean getValueAsBoolean()

Gets the value of this EntityProperty as a .

Boolean getValueAsBooleanObject()

Gets the value of this EntityProperty as a .

byte [] getValueAsByteArray()

Gets the value of this EntityProperty as a array.

Byte [] getValueAsByteObjectArray()

Gets the value of this EntityProperty as a array.

Date getValueAsDate()

Gets the value of this EntityProperty as a .

double getValueAsDouble()

Gets the value of this EntityProperty as a .

Double getValueAsDoubleObject()

Gets the value of this EntityProperty as a .

int getValueAsInteger()

Gets the value of this EntityProperty as an .

Integer getValueAsIntegerObject()

Gets the value of this EntityProperty as an .

long getValueAsLong()

Gets the value of this EntityProperty as a .

Long getValueAsLongObject()

Gets the value of this EntityProperty as a .

String getValueAsString()

Gets the value of this EntityProperty as a .

UUID getValueAsUUID()

Gets the value of this EntityProperty as a .

boolean isEncrypted()

Gets a flag indicating whether the EntityProperty value is encrypted.

void setIsEncrypted(boolean isEncrypted)

Sets a flag indicating whether the EntityProperty value is encrypted.

synchronized final void setValue(final boolean value)

Sets this EntityProperty using the serialized value.

synchronized final void setValue(final Boolean value)

Sets this EntityProperty using the serialized value.

synchronized final void setValue(final byte[] value)

Sets this EntityProperty using the serialized value.

synchronized final void setValue(final Byte[] value)

Sets this EntityProperty using the serialized value.

synchronized final void setValue(final Date value)

Sets this EntityProperty using the serialized value.

synchronized final void setValue(final double value)

Sets this EntityProperty using the serialized value.

synchronized final void setValue(final Double value)

Sets this EntityProperty using the serialized value.

synchronized final void setValue(final int value)

Sets this EntityProperty using the serialized value.

synchronized final void setValue(final Integer value)

Sets this EntityProperty using the serialized value.

synchronized final void setValue(final long value)

Sets this EntityProperty using the serialized value.

synchronized final void setValue(final Long value)

Sets this EntityProperty using the serialized value.

synchronized final void setValue(final String value)

Sets this EntityProperty using the value.

synchronized final void setValue(final UUID value)

Sets this EntityProperty using the serialized value.

Constructor Details

EntityProperty

public EntityProperty(final boolean value)

Constructs an EntityProperty instance from a value.

Parameters:

value - The boolean value of the entity property to set.

EntityProperty

public EntityProperty(final Boolean value)

Constructs an EntityProperty instance from a value.

Parameters:

value - The Boolean value of the entity property to set.

EntityProperty

public EntityProperty(final byte[] value)

Constructs an EntityProperty instance from a value.

Parameters:

value - The byte[] value of the entity property to set.

EntityProperty

public EntityProperty(final Byte[] value)

Constructs an EntityProperty instance from a .

Parameters:

value - The Byte[] to set as the entity property value.

EntityProperty

public EntityProperty(final Date value)

Constructs an EntityProperty instance from a value.

Parameters:

value - The java.util.Date to set as the entity property value.

EntityProperty

public EntityProperty(final double value)

Constructs an EntityProperty instance from a value.

Parameters:

value - The double value of the entity property to set.

EntityProperty

public EntityProperty(final Double value)

Constructs an EntityProperty instance from a value.

Parameters:

value - The Double value of the entity property to set.

EntityProperty

public EntityProperty(final int value)

Constructs an EntityProperty instance from an value.

Parameters:

value - The int value of the entity property to set.

EntityProperty

public EntityProperty(final Integer value)

Constructs an EntityProperty instance from an value.

Parameters:

value - The Integer value of the entity property to set.

EntityProperty

public EntityProperty(final long value)

Constructs an EntityProperty instance from a value.

Parameters:

value - The long value of the entity property to set.

EntityProperty

public EntityProperty(final Long value)

Constructs an EntityProperty instance from a value.

Parameters:

value - The Long value of the entity property to set.

EntityProperty

protected EntityProperty(final Object value, final Class type)

Reserved for internal use. Constructs an EntityProperty instance from a value and a data type, and verifies that the value can be interpreted as the specified data type.

Parameters:

value - The Object to convert to a string and store.
type - The Class<?> type of the value to construct.

EntityProperty

public EntityProperty(final String value)

Constructs an EntityProperty instance from a value.

Parameters:

value - The String to set as the entity property value.

EntityProperty

protected EntityProperty(final String value, final Class type)

Reserved for internal use. Constructs an EntityProperty instance from a value type, and verifies that the value can be interpreted as the specified data type.

Parameters:

value - The Object to convert to a string and store.
type

EntityProperty

protected EntityProperty(final String value, final EdmType edmType)

Reserved for internal use. Constructs an EntityProperty instance from a value and a data type, and verifies that the value can be interpreted as the specified data type.

Parameters:

value - The String representation of the value to construct.
edmType - The EdmType data type of the value to construct.

EntityProperty

public EntityProperty(final UUID value)

Constructs an EntityProperty instance from a value.

Parameters:

value - The java.util.UUID to set as the entity property value.

Method Details

getEdmType

public EdmType getEdmType()

Gets the EdmType storage data type for the EntityProperty.

Returns:

The EdmType enumeration value for the data type of the EntityProperty.

getIsNull

public boolean getIsNull()

Gets a flag indicating that the EntityProperty value is .

Returns:

A boolean flag indicating that the EntityProperty value is null.

getType

public Class getType()

Gets the class type of the EntityProperty.

Returns:

The Class<?> of the EntityProperty.

getValueAsBoolean

public boolean getValueAsBoolean()

Gets the value of this EntityProperty as a .

Returns:

A boolean representation of the EntityProperty value.

Throws:

IllegalArgumentException - If the value is null or cannot be parsed as a Boolean.

getValueAsBooleanObject

public Boolean getValueAsBooleanObject()

Gets the value of this EntityProperty as a .

Returns:

A Boolean representation of the EntityProperty value.

Throws:

IllegalArgumentException - If the value is null or cannot be parsed as a Boolean.

getValueAsByteArray

public byte [] getValueAsByteArray()

Gets the value of this EntityProperty as a array.

Returns:

A byte[] representation of the EntityProperty value, or null.

getValueAsByteObjectArray

public Byte [] getValueAsByteObjectArray()

Gets the value of this EntityProperty as a array.

Returns:

A Byte[] representation of the EntityProperty value, or null.

getValueAsDate

public Date getValueAsDate()

Gets the value of this EntityProperty as a .

Returns:

A java.util.Date representation of the EntityProperty value, or null.

Throws:

IllegalArgumentException - If the value is not null and cannot be parsed as a java.util.Date.

getValueAsDouble

public double getValueAsDouble()

Gets the value of this EntityProperty as a .

Returns:

A double representation of the EntityProperty value.

Throws:

IllegalArgumentException - If the value is null or cannot be parsed as a double.

getValueAsDoubleObject

public Double getValueAsDoubleObject()

Gets the value of this EntityProperty as a .

Returns:

A double representation of the EntityProperty value.

Throws:

IllegalArgumentException - If the value is null or cannot be parsed as a double.

getValueAsInteger

public int getValueAsInteger()

Gets the value of this EntityProperty as an .

Returns:

An int representation of the EntityProperty value.

Throws:

IllegalArgumentException - If the value is null or cannot be parsed as an int.

getValueAsIntegerObject

public Integer getValueAsIntegerObject()

Gets the value of this EntityProperty as an .

Returns:

An Integer representation of the EntityProperty value.

Throws:

IllegalArgumentException - If the value is null or cannot be parsed as an int.

getValueAsLong

public long getValueAsLong()

Gets the value of this EntityProperty as a .

Returns:

A long representation of the EntityProperty value.

Throws:

IllegalArgumentException - If the value is null or cannot be parsed as a long.

getValueAsLongObject

public Long getValueAsLongObject()

Gets the value of this EntityProperty as a .

Returns:

A long representation of the EntityProperty value.

Throws:

IllegalArgumentException - If the value is null or cannot be parsed as a long.

getValueAsString

public String getValueAsString()

Gets the value of this EntityProperty as a .

Returns:

A String representation of the EntityProperty value, or null.

getValueAsUUID

public UUID getValueAsUUID()

Gets the value of this EntityProperty as a .

Returns:

A java.util.UUID representation of the EntityProperty value, or null.

Throws:

IllegalArgumentException - If the value cannot be parsed as a java.util.UUID.

isEncrypted

protected boolean isEncrypted()

Gets a flag indicating whether the EntityProperty value is encrypted.

Returns:

A boolean flag indicating whether the EntityProperty value is encrypted.

setIsEncrypted

protected void setIsEncrypted(boolean isEncrypted)

Sets a flag indicating whether the EntityProperty value is encrypted.

Parameters:

isEncrypted - A boolean flag indicating whether the EntityProperty value is encrypted.

setValue

public synchronized final void setValue(final boolean value)

Sets this EntityProperty using the serialized value.

Parameters:

value - The boolean value to set as the EntityProperty value.

setValue

public synchronized final void setValue(final Boolean value)

Sets this EntityProperty using the serialized value.

Parameters:

value - The Boolean value to set as the EntityProperty value.

setValue

public synchronized final void setValue(final byte[] value)

Sets this EntityProperty using the serialized value.

Parameters:

value - The byte[] value to set as the EntityProperty value. This value may be null.

setValue

public synchronized final void setValue(final Byte[] value)

Sets this EntityProperty using the serialized value.

Parameters:

value - The Byte[] value to set as the EntityProperty value. This value may be null.

setValue

public synchronized final void setValue(final Date value)

Sets this EntityProperty using the serialized value.

Parameters:

value - The java.util.Date value to set as the EntityProperty value. This value may be null.

setValue

public synchronized final void setValue(final double value)

Sets this EntityProperty using the serialized value.

Parameters:

value - The double value to set as the EntityProperty value.

setValue

public synchronized final void setValue(final Double value)

Sets this EntityProperty using the serialized value.

Parameters:

value - The Double value to set as the EntityProperty value.

setValue

public synchronized final void setValue(final int value)

Sets this EntityProperty using the serialized value.

Parameters:

value - The int value to set as the EntityProperty value.

setValue

public synchronized final void setValue(final Integer value)

Sets this EntityProperty using the serialized value.

Parameters:

value - The Integer value to set as the EntityProperty value.

setValue

public synchronized final void setValue(final long value)

Sets this EntityProperty using the serialized value.

Parameters:

value - The long value to set as the EntityProperty value.

setValue

public synchronized final void setValue(final Long value)

Sets this EntityProperty using the serialized value.

Parameters:

value - The Long value to set as the EntityProperty value.

setValue

public synchronized final void setValue(final String value)

Sets this EntityProperty using the value.

Parameters:

value - The String value to set as the EntityProperty value. This value may be null.

setValue

public synchronized final void setValue(final UUID value)

Sets this EntityProperty using the serialized value.

Parameters:

value - The java.util.UUID value to set as the EntityProperty value. This value may be null.

Applies to