public class AbstractExtensibleObject extends Object implements ExtensibleObject
| Constructor and Description |
|---|
AbstractExtensibleObject() |
AbstractExtensibleObject(Map<String,?> values)
Creates a new object with the given attributes.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Expose
Cloneable#clone() as public |
String |
describe()
Output a full description of this object.
|
boolean |
equals(Object obj)
Default implementation counts objects equal if their describe() methods return equal strings.
|
<T> T |
get(String attribute,
Class<T> type)
Return the current value of the given attribute name, converted to the passed type.
|
<T> T |
get(String attribute,
T defaultValue)
Works like
ExtensibleObject.get(String, Class) but if the attribute is null or not defined, returns the passed defaultValue. |
protected <T> T |
get(String attribute,
T defaultValue,
Class<T> type) |
SortedSet<String> |
getAttributes()
Return the names of all the set attributes.
|
protected Object |
getFieldValue(String attribute,
Class type) |
ObjectMetaData |
getObjectMetaData()
Returns the
ObjectMetaData describing this instance. |
List |
getValuePath(String attributes,
Class lastType)
Traverses dot-separated attributes in the attributePath and returns a list containing all the intermediate values.
|
boolean |
has(String key)
Return true if the given key is defined.
|
int |
hashCode() |
ExtensibleObject |
set(String attribute,
Object value)
Sets the value of the given attribute.
|
String |
toString() |
public SortedSet<String> getAttributes()
ExtensibleObjectgetAttributes in interface ExtensibleObjectpublic ObjectMetaData getObjectMetaData()
ExtensibleObjectObjectMetaData describing this instance.getObjectMetaData in interface ExtensibleObjectpublic boolean has(String key)
has in interface ExtensibleObjectpublic <T> T get(String attribute, Class<T> type)
ExtensibleObjectObjectUtil.convert(Object, Class).
Should traverse dot-separated attributes.get in interface ExtensibleObjectpublic <T> T get(String attribute, T defaultValue)
ExtensibleObjectExtensibleObject.get(String, Class) but if the attribute is null or not defined, returns the passed defaultValue.
Uses the type of defaultValue to determine the type to convert the current value to.
If null is passed to the default value, no conversion of attribute is made if it is set.
If traversing a dot-separated attribute path, return the default value if any along the path are null.get in interface ExtensibleObjectpublic List getValuePath(String attributes, Class lastType)
ExtensibleObjectgetValuePath in interface ExtensibleObjectlastType - the type to convert the last value in the list to.public ExtensibleObject set(String attribute, Object value)
ExtensibleObjectset in interface ExtensibleObjectpublic String describe()
ExtensibleObjectdescribe in interface ExtensibleObjectpublic boolean equals(Object obj)
public Object clone()
ExtensibleObjectCloneable#clone() as publicclone in interface ExtensibleObjectclone in class ObjectCopyright © 2021 Liquibase.org. All rights reserved.