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.SerializationTypeGENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE| Constructor and Description |
|---|
AbstractDatabaseObject() |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Object o) |
<T> T |
getAttribute(String attribute,
Class<T> type)
Retrieves the value of a
DatabaseObject's attributes and cast it into the desired type. |
<T> T |
getAttribute(String attribute,
T defaultValue)
Retrieves the value of a
DatabaseObject's attributes and cast it into the desired type. |
Set<String> |
getAttributes()
Returns the name of all attributes currently stored for this
DatabaseObject. |
String |
getObjectTypeName() |
String |
getSerializableFieldNamespace(String field) |
Set<String> |
getSerializableFields() |
LiquibaseSerializable.SerializationType |
getSerializableFieldType(String field) |
Object |
getSerializableFieldValue(String field) |
String |
getSerializedObjectName() |
String |
getSerializedObjectNamespace() |
String |
getSnapshotId() |
void |
load(ParsedNode parsedNode,
ResourceAccessor resourceAccessor) |
ParsedNode |
serialize() |
DatabaseObject |
setAttribute(String attribute,
Object value)
Sets a given attribute for this object to the specified value.
|
void |
setSnapshotId(String snapshotId) |
boolean |
shouldIncludeCatalogInSpecification()
Convenience method to check if the object types should consider catalog name
also during comparision (equals(), hashcode() and compareTo())
|
boolean |
snapshotByDefault() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetContainingObjects, getName, getSchema, setNamepublic String getObjectTypeName()
getObjectTypeName in interface DatabaseObjectpublic String getSnapshotId()
getSnapshotId in interface DatabaseObjectpublic void setSnapshotId(String snapshotId)
setSnapshotId in interface DatabaseObjectpublic boolean snapshotByDefault()
snapshotByDefault in interface DatabaseObjectpublic int compareTo(Object o)
compareTo in interface Comparablepublic Set<String> getAttributes()
DatabaseObjectDatabaseObject.getAttributes in interface DatabaseObjectpublic <T> T getAttribute(String attribute, Class<T> type)
DatabaseObjectDatabaseObject's attributes and cast it into the desired type.getAttribute in interface DatabaseObjectT - 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)
DatabaseObjectDatabaseObject's attributes and cast it into the desired type.getAttribute in interface DatabaseObjectT - 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)
DatabaseObjectsetAttribute in interface DatabaseObjectattribute - case-sensitive name of the attributevalue - value to be setpublic String getSerializedObjectName()
getSerializedObjectName in interface LiquibaseSerializablepublic String getSerializedObjectNamespace()
getSerializedObjectNamespace in interface LiquibaseSerializablepublic String getSerializableFieldNamespace(String field)
getSerializableFieldNamespace in interface LiquibaseSerializablepublic Set<String> getSerializableFields()
getSerializableFields in interface LiquibaseSerializablepublic Object getSerializableFieldValue(String field)
getSerializableFieldValue in interface LiquibaseSerializablepublic LiquibaseSerializable.SerializationType getSerializableFieldType(String field)
getSerializableFieldType in interface LiquibaseSerializablepublic void load(ParsedNode parsedNode, ResourceAccessor resourceAccessor) throws ParsedNodeException
load in interface LiquibaseSerializableParsedNodeExceptionpublic ParsedNode serialize()
serialize in interface LiquibaseSerializablepublic boolean shouldIncludeCatalogInSpecification()
Copyright © 2019 Liquibase.org. All rights reserved.