public class EntityValues
extends java.lang.Object
Constructor and Description |
---|
EntityValues() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
getCreatedBy(java.lang.Object entity) |
static java.lang.Object |
getCreatedDate(java.lang.Object entity) |
static java.lang.Object |
getDeletedBy(java.lang.Object entity) |
static java.lang.Object |
getDeletedDate(java.lang.Object entity) |
static java.lang.Object |
getGeneratedId(java.lang.Object entity) |
static java.lang.Object |
getId(java.lang.Object entity) |
static java.lang.Object |
getIdOrEntity(java.lang.Object entity) |
static java.lang.Object |
getLastModifiedBy(java.lang.Object entity) |
static java.lang.Object |
getLastModifiedDate(java.lang.Object entity) |
static java.util.UUID |
getUuid(java.lang.Object entity) |
static <T> T |
getValue(java.lang.Object entity,
java.lang.String name)
Get an attribute value.
|
static <T> T |
getValueEx(java.lang.Object entity,
PropertyPath propertyPath)
Get an attribute value.
|
static <T> T |
getValueEx(java.lang.Object entity,
java.lang.String propertyPath)
Get an attribute value.
|
static <T> T |
getValueEx(java.lang.Object entity,
java.lang.String[] properties)
Get value of an attribute according to the rules described in
getValueEx(Object, String) . |
static java.lang.Object |
getVersion(java.lang.Object entity) |
static boolean |
isAuditSupported(java.lang.Object entity) |
static boolean |
isEntity(java.lang.Object entity) |
static boolean |
isSoftDeleted(java.lang.Object entity) |
static boolean |
isSoftDeletionSupported(java.lang.Object entity) |
static boolean |
isUuidSupported(java.lang.Object entity) |
static boolean |
isVersionSupported(java.lang.Object entity) |
static boolean |
propertyValueEquals(java.lang.Object a,
java.lang.Object b)
Used by to check whether a property value has been changed.
|
static void |
setCreatedBy(java.lang.Object entity,
java.lang.Object value) |
static void |
setCreatedDate(java.lang.Object entity,
java.lang.Object value) |
static void |
setDeletedBy(java.lang.Object entity,
java.lang.Object value) |
static void |
setDeletedDate(java.lang.Object entity,
java.lang.Object value) |
static void |
setGeneratedId(java.lang.Object entity,
java.lang.Object id) |
static void |
setId(java.lang.Object entity,
java.lang.Object key) |
static void |
setLastModifiedBy(java.lang.Object entity,
java.lang.Object value) |
static void |
setLastModifiedDate(java.lang.Object entity,
java.lang.Object value) |
static void |
setUuid(java.lang.Object entity,
java.util.UUID uuid) |
static void |
setValue(java.lang.Object entity,
java.lang.String name,
java.lang.Object value)
Set an attribute value.
|
static void |
setValue(java.lang.Object entity,
java.lang.String name,
java.lang.Object value,
boolean checkEquals)
Set an attribute value.
|
static void |
setValueEx(java.lang.Object entity,
PropertyPath propertyPath,
java.lang.Object value)
Set an attribute value.
|
static void |
setValueEx(java.lang.Object entity,
java.lang.String[] properties,
java.lang.Object value)
Set value of an attribute according to the rules described in
setValueEx(Object, String, Object) . |
static void |
setValueEx(java.lang.Object entity,
java.lang.String propertyPath,
java.lang.Object value)
Set an attribute value.
|
static void |
setVersion(java.lang.Object entity,
java.lang.Object version) |
public static boolean isEntity(java.lang.Object entity)
@Nullable public static java.lang.Object getId(java.lang.Object entity)
public static void setId(java.lang.Object entity, java.lang.Object key)
public static java.lang.Object getIdOrEntity(java.lang.Object entity)
public static java.lang.Object getGeneratedId(java.lang.Object entity)
public static void setGeneratedId(java.lang.Object entity, java.lang.Object id)
public static void setValue(java.lang.Object entity, java.lang.String name, java.lang.Object value)
EntityPropertyChangeListener
s only if the attribute
was actually changed.name
- attribute name according to JavaBeans notationvalue
- attribute valuepublic static void setValue(java.lang.Object entity, java.lang.String name, java.lang.Object value, boolean checkEquals)
EntityPropertyChangeListener
s only if the attribute
was actually changed.name
- attribute name according to JavaBeans notationvalue
- attribute valuecheckEquals
- check equals for previous and new value.
If flag is true and objects equals, then setter will not be invoked@Nullable public static <T> T getValue(java.lang.Object entity, java.lang.String name)
name
- attribute name according to JavaBeans notation@Nullable public static <T> T getValueEx(java.lang.Object entity, java.lang.String propertyPath)
car.driver.name
.propertyPath
- path to an attributeEntity
, this method
stops here and returns this value.@Nullable public static <T> T getValueEx(java.lang.Object entity, PropertyPath propertyPath)
car.driver.name
.propertyPath
- path to an attributeEntity
, this method
stops here and returns this value.public static void setValueEx(java.lang.Object entity, java.lang.String propertyPath, java.lang.Object value)
car.driver.name
.
car.driver
attribute, and if it is not
null and is an Entity
, sets value of name
attribute in it.
EntityPropertyChangeListener
s only if the attribute
was actually changed.propertyPath
- path to an attributevalue
- attribute valuepublic static void setValueEx(java.lang.Object entity, PropertyPath propertyPath, java.lang.Object value)
car.driver.name
.
car.driver
attribute, and if it is not
null and is an Entity
, sets value of name
attribute in it.
EntityPropertyChangeListener
s only if the attribute
was actually changed.propertyPath
- path to an attributevalue
- attribute valuepublic static void setValueEx(java.lang.Object entity, java.lang.String[] properties, java.lang.Object value)
setValueEx(Object, String, Object)
.entity
- instanceproperties
- path to the attributevalue
- attribute valuepublic static <T> T getValueEx(java.lang.Object entity, java.lang.String[] properties)
getValueEx(Object, String)
.entity
- entityproperties
- path to the attributepublic static boolean propertyValueEquals(@Nullable java.lang.Object a, @Nullable java.lang.Object b)
a
- an objectb
- an objecta
equals to b
, but in case of a
is or Collection
returns
true only if a
is the same instance as b
public static boolean isUuidSupported(java.lang.Object entity)
@Nullable public static java.util.UUID getUuid(java.lang.Object entity)
public static void setUuid(java.lang.Object entity, java.util.UUID uuid)
public static boolean isVersionSupported(java.lang.Object entity)
@Nullable public static java.lang.Object getVersion(java.lang.Object entity)
public static void setVersion(java.lang.Object entity, java.lang.Object version)
public static boolean isSoftDeletionSupported(java.lang.Object entity)
public static boolean isSoftDeleted(java.lang.Object entity)
public static java.lang.Object getDeletedDate(java.lang.Object entity)
public static void setDeletedDate(java.lang.Object entity, java.lang.Object value)
public static java.lang.Object getDeletedBy(java.lang.Object entity)
public static void setDeletedBy(java.lang.Object entity, java.lang.Object value)
public static boolean isAuditSupported(java.lang.Object entity)
public static java.lang.Object getCreatedDate(java.lang.Object entity)
public static void setCreatedDate(java.lang.Object entity, java.lang.Object value)
public static java.lang.Object getCreatedBy(java.lang.Object entity)
public static void setCreatedBy(java.lang.Object entity, java.lang.Object value)
public static java.lang.Object getLastModifiedDate(java.lang.Object entity)
public static void setLastModifiedDate(java.lang.Object entity, java.lang.Object value)
public static java.lang.Object getLastModifiedBy(java.lang.Object entity)
public static void setLastModifiedBy(java.lang.Object entity, java.lang.Object value)