Package liquibase
Class AbstractExtensibleObject
java.lang.Object
liquibase.AbstractExtensibleObject
- All Implemented Interfaces:
Cloneable,ExtensibleObject
- Direct Known Subclasses:
AbstractLogger,AbstractPlugin,AbstractResourceAccessor,CompositeUIService,ConsoleUIService,LoggerUIService
Convenience class implementing ExtensibleObject. It is usually easiest to extend this class rather than implement all of ExtensibleObject yourself.
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractExtensibleObject(Map<String, ?> values) Creates a new object with the given attributes. -
Method Summary
Modifier and TypeMethodDescriptionclone()ExposeCloneable#clone()as publicdescribe()Output a full description of this object.booleanDefault implementation counts objects equal if their describe() methods return equal strings.<T> TReturn the current value of the given attribute name, converted to the passed type.<T> TWorks likeExtensibleObject.get(String, Class)but if the attribute is null or not defined, returns the passed defaultValue.protected <T> TReturn the names of all the set attributes.protected ObjectgetFieldValue(String attribute, Class type) Returns theObjectMetaDatadescribing this instance.getValuePath(String attributes, Class lastType) Traverses dot-separated attributes in the attributePath and returns a list containing all the intermediate values.booleanReturn true if the given key is defined.inthashCode()Sets the value of the given attribute.toString()
-
Constructor Details
-
AbstractExtensibleObject
public AbstractExtensibleObject() -
AbstractExtensibleObject
Creates a new object with the given attributes.
-
-
Method Details
-
getAttributes
Description copied from interface:ExtensibleObjectReturn the names of all the set attributes. If an attribute is null the name should not be returned. Should return both "standard" attributes and any custom attributes that have been set.- Specified by:
getAttributesin interfaceExtensibleObject
-
getObjectMetaData
Description copied from interface:ExtensibleObjectReturns theObjectMetaDatadescribing this instance.- Specified by:
getObjectMetaDatain interfaceExtensibleObject
-
has
Return true if the given key is defined.- Specified by:
hasin interfaceExtensibleObject
-
get
Description copied from interface:ExtensibleObjectReturn the current value of the given attribute name, converted to the passed type. If the passed attribute is null or not defined, returns null. If you do not know the type to convert to, pass Object.class as the type. Conversion is done usingObjectUtil.convert(Object, Class). Should traverse dot-separated attributes.- Specified by:
getin interfaceExtensibleObject
-
get
Description copied from interface:ExtensibleObjectWorks likeExtensibleObject.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.
- Specified by:
getin interfaceExtensibleObject
-
get
-
getValuePath
Description copied from interface:ExtensibleObjectTraverses dot-separated attributes in the attributePath and returns a list containing all the intermediate values.- Specified by:
getValuePathin interfaceExtensibleObjectlastType- the type to convert the last value in the list to.
-
getFieldValue
-
set
Description copied from interface:ExtensibleObjectSets the value of the given attribute. Subclasses can override this method to provide conversion business logic, but must remember that fields can be set directly when no type conversion is needed.- Specified by:
setin interfaceExtensibleObject
-
describe
Description copied from interface:ExtensibleObjectOutput a full description of this object. Should include all attributes and values.- Specified by:
describein interfaceExtensibleObject
-
toString
-
hashCode
public int hashCode() -
equals
Default implementation counts objects equal if their describe() methods return equal strings. -
clone
Description copied from interface:ExtensibleObjectExposeCloneable#clone()as public- Specified by:
clonein interfaceExtensibleObject- Overrides:
clonein classObject
-