public final class InstanceUtils
extends java.lang.Object
Instance
s.Modifier and Type | Method and Description |
---|---|
static Instance |
copy(Instance source)
Deprecated.
|
static void |
copy(Instance source,
Instance dest)
Deprecated.
|
static java.lang.String |
formatValuePath(java.lang.String[] path)
Converts an array of identifiers to a dot-separated string, enclosing identifiers, containing dots, in square
brackets.
|
static java.lang.String |
getInstanceName(Instance instance)
Deprecated.
|
static <T> T |
getValueEx(Instance instance,
Instance.BeanPropertyPath propertyPath)
Get value of an attribute according to the rules described in
Instance.getValueEx(String) . |
static <T> T |
getValueEx(Instance instance,
java.lang.String propertyPath)
Get value of an attribute according to the rules described in
Instance.getValueEx(String) . |
static <T> T |
getValueEx(Instance instance,
java.lang.String[] properties)
Get value of an attribute according to the rules described in
Instance.getValueEx(String) . |
static java.lang.String[] |
parseValuePath(java.lang.String path)
Converts a string of identifiers separated by dots to an array.
|
static boolean |
propertyValueEquals(java.lang.Object a,
java.lang.Object b)
Used by
AbstractInstance to check whether a property value has been changed. |
static void |
setValueEx(Instance instance,
Instance.BeanPropertyPath propertyPath,
java.lang.Object value)
Set value of an attribute according to the rules described in
Instance.setValueEx(String, Object) . |
static void |
setValueEx(Instance instance,
java.lang.String[] properties,
java.lang.Object value)
Set value of an attribute according to the rules described in
Instance.setValueEx(String, Object) . |
static void |
setValueEx(Instance instance,
java.lang.String propertyPath,
java.lang.Object value)
Set value of an attribute according to the rules described in
Instance.setValueEx(String, Object) . |
public static java.lang.String[] parseValuePath(@Nullable java.lang.String path)
car.driver.name [car.field].driver.name
path
- value path as stringpublic static java.lang.String formatValuePath(java.lang.String[] path)
path
- value path as arraypublic static <T> T getValueEx(Instance instance, java.lang.String propertyPath)
Instance.getValueEx(String)
.instance
- instancepropertyPath
- attribute pathpublic static <T> T getValueEx(Instance instance, Instance.BeanPropertyPath propertyPath)
Instance.getValueEx(String)
.instance
- instancepropertyPath
- attribute pathpublic static <T> T getValueEx(Instance instance, java.lang.String[] properties)
Instance.getValueEx(String)
.instance
- instanceproperties
- path to the attributepublic static void setValueEx(Instance instance, java.lang.String propertyPath, java.lang.Object value)
Instance.setValueEx(String, Object)
.instance
- instancepropertyPath
- path to the attributevalue
- attribute valuepublic static void setValueEx(Instance instance, Instance.BeanPropertyPath propertyPath, java.lang.Object value)
Instance.setValueEx(String, Object)
.instance
- instancepropertyPath
- path to the attributevalue
- attribute valuepublic static void setValueEx(Instance instance, java.lang.String[] properties, java.lang.Object value)
Instance.setValueEx(String, Object)
.instance
- instanceproperties
- path to the attributevalue
- attribute value@Deprecated public static Instance copy(Instance source)
@Deprecated public static void copy(Instance source, Instance dest)
@Deprecated public static java.lang.String getInstanceName(Instance instance)
MetadataTools.getInstanceName(com.haulmont.chile.core.model.Instance)
instead.instance
- instanceNamePattern
or toString()
.public static boolean propertyValueEquals(java.lang.Object a, java.lang.Object b)
AbstractInstance
to check whether a property value has been changed.a
- an objectb
- an objecta
equals to b
, but in case of a
is AbstractInstance
or Collection
returns
true only if a
is the same instance as b