public abstract class EntityData extends Object implements Cloneable
| Constructor and Description |
|---|
EntityData() |
| Modifier and Type | Method and Description |
|---|---|
abstract <T> T |
as(Class<T> t)
Returns a POJO based on EntityData
|
abstract Map<String,Object> |
asMap()
Returns the map of all the properties of a given EntityData instance.
|
abstract boolean |
contains(String name)
Checks whether a particular element is present.
|
static EntityData |
createFrom(Object data,
String entityName)
Returns an EntityData instance which is based on the POJO passed as parameter
|
static EntityData |
createFromDeepMap(Map<String,Object> propertiesMap,
Map<String,List<String>> keys,
String entityName)
Returns an EntityData instance which is based on a list of properties
|
static EntityData |
createFromMap(Map<String,Object> propertiesMap,
List<String> keys,
String entityName)
Returns an EntityData instance which is based on a list of properties
|
abstract Map<String,Object> |
getAssociations()
Returns the collection of all associations.
|
abstract Object |
getAssociationValue(String name)
Returns the value of a specific association
If this method returns null, then it means that the association is not present.
|
static EntityDataBuilder |
getBuilder()
Returns an EntityDataBuilder instance which can be used to construct an entityData from scratch.
|
static EntityDataBuilder |
getBuilder(EntityData entityData)
Returns an EntityDataBuilder instance which is partially initialized based on the passed entityData.
|
Object |
getElementValue(String name)
Returns the value of a particular element.
|
abstract Map<String,Object> |
getMap()
Returns the properties of the entity.
|
public abstract boolean contains(String name)
name - The name of element to check.public abstract Object getAssociationValue(String name)
name - Name of the associationpublic abstract Map<String,Object> getAssociations()
public Object getElementValue(String name)
name - Name of the element.public static EntityDataBuilder getBuilder()
public static EntityDataBuilder getBuilder(EntityData entityData)
entityData - The entityData from which a new EntityData is to be constructed, for example by adding an extra element.public static EntityData createFromMap(Map<String,Object> propertiesMap, List<String> keys, String entityName)
propertiesMap - List of properties used to construct a new instance of EntityDatakeys - List of key namesentityName - Name of the newly created entitypublic static EntityData createFromDeepMap(Map<String,Object> propertiesMap, Map<String,List<String>> keys, String entityName)
propertiesMap - List of properties and associations used to construct a new instance of EntityDatakeys - Map of List of key based on entity nameentityName - Fully qualified entityname along with service namepublic abstract Map<String,Object> asMap()
public static EntityData createFrom(Object data, String entityName)
data - A POJO instanceentityName - Name of the newly created entitypublic abstract <T> T as(Class<T> t) throws DataConversionException
T - A POJO classDataConversionExceptionCopyright © 2020 SAP. All Rights Reserved.