Entity Class

  • java.lang.Object
    • com.microsoft.bot.schema.Entity

Implements

public class Entity
implements EntitySerialization

Metadata object pertaining to an activity.

Constructor Summary

Constructor Description
Entity()

Method Summary

Modifier and Type Method and Description
static T <T>getAs(EntitySerialization entity, Class<T> classType)

Converts Entity to other Entity types.

T <T>getAs(Class<T> classType)

Converts Entity to other Entity types.

Entity <T>setAs(T obj)

Converts other Entity types to Entity.

static Entity clone(Entity entity)

Performs a deep copy of an Entity.

static java.util.List<Entity> cloneList(List<? extends Entity> entities)

Performs a deep copy of a List of Entities.

java.util.Map<java.lang.String,com.fasterxml.jackson.databind.JsonNode> getProperties()

Additional properties not defined by this class.

java.lang.String getType()

Type of this entity (RFC 3987 IRI).

void setProperties(String key, JsonNode value)

Additional properties not defined by this class.

void setType(String withType)

Type of this entity (RFC 3987 IRI).

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

Entity

public Entity()

Method Details

<T>getAs

public static T getAs(EntitySerialization entity, Class classType)

Converts Entity to other Entity types.

Parameters:

entity - The entity type object.
classType - Class extended EntitySerialization

Returns:

Entity converted to type T

<T>getAs

public T getAs(Class classType)

Converts Entity to other Entity types.

Parameters:

classType - Class extended EntitySerialization

Returns:

Entity converted to type T

<T>setAs

public Entity setAs(T obj)

Converts other Entity types to Entity. This is only intended to be used with other Entity classes:

Parameters:

obj - of type T

Returns:

This Entity with the properties from the passed sub-Entity.

Throws:

java.lang.IllegalArgumentException - For arguments that can't be converted.

clone

public static Entity clone(Entity entity)

Performs a deep copy of an Entity.

Parameters:

entity - The Entity to clone.

Returns:

The cloned Entity.

cloneList

public static List cloneList(List entities)

Performs a deep copy of a List of Entities.

Parameters:

entities - The List of Entities to clone.

Returns:

A cloned List.

getProperties

public Map getProperties()

Additional properties not defined by this class.

Returns:

The Map of additional properties.

getType

public String getType()

Type of this entity (RFC 3987 IRI).

Returns:

the type value

setProperties

public void setProperties(String key, JsonNode value)

Additional properties not defined by this class.

Parameters:

key - The key name of the property to set.
value - The value of the property.

setType

public void setType(String withType)

Type of this entity (RFC 3987 IRI).

Parameters:

withType - the type value to set

Applies to