public abstract class AbstractDatabaseObject extends Object implements DatabaseObject
Table
,
PrimaryKey
and Column
.
Core features of this class include the functionality for the attributes collection ( getAttributes()
}
and the ability to load an object from a serialised form load(ParsedNode, ResourceAccessor)
.LiquibaseSerializable.SerializationType
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE
Constructor and Description |
---|
AbstractDatabaseObject() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getContainingObjects, getName, getSchema, setName
public String getObjectTypeName()
getObjectTypeName
in interface DatabaseObject
public String getSnapshotId()
getSnapshotId
in interface DatabaseObject
public void setSnapshotId(String snapshotId)
setSnapshotId
in interface DatabaseObject
public boolean snapshotByDefault()
snapshotByDefault
in interface DatabaseObject
public int compareTo(Object o)
compareTo
in interface Comparable
public Set<String> getAttributes()
DatabaseObject
DatabaseObject
.getAttributes
in interface DatabaseObject
public <T> T getAttribute(String attribute, Class<T> type)
DatabaseObject
DatabaseObject
's attributes and cast it into the desired type.getAttribute
in interface DatabaseObject
T
- the desired type of the valueattribute
- case-sensitive name of the attribute for which the value will be retrievedtype
- class compatible with the desired type T of the return valueRuntimeException
will occur.public <T> T getAttribute(String attribute, T defaultValue)
DatabaseObject
DatabaseObject
's attributes and cast it into the desired type.getAttribute
in interface DatabaseObject
T
- the desired type of the valueattribute
- case-sensitive name of the attribute for which the value will be retrieveddefaultValue
- the value to be returned if no value (not even null) is stored for the attribute name in the
object.RuntimeException
will occur.public DatabaseObject setAttribute(String attribute, Object value)
DatabaseObject
setAttribute
in interface DatabaseObject
attribute
- case-sensitive name of the attributevalue
- value to be setpublic String getSerializedObjectName()
getSerializedObjectName
in interface LiquibaseSerializable
public String getSerializedObjectNamespace()
getSerializedObjectNamespace
in interface LiquibaseSerializable
public String getSerializableFieldNamespace(String field)
getSerializableFieldNamespace
in interface LiquibaseSerializable
public Set<String> getSerializableFields()
getSerializableFields
in interface LiquibaseSerializable
public Object getSerializableFieldValue(String field)
getSerializableFieldValue
in interface LiquibaseSerializable
public LiquibaseSerializable.SerializationType getSerializableFieldType(String field)
getSerializableFieldType
in interface LiquibaseSerializable
public void load(ParsedNode parsedNode, ResourceAccessor resourceAccessor) throws ParsedNodeException
load
in interface LiquibaseSerializable
ParsedNodeException
public ParsedNode serialize()
serialize
in interface LiquibaseSerializable
Copyright © 2019 Liquibase.org. All rights reserved.