Interface DatabaseObject

    • Method Detail

      • getSnapshotId

        String getSnapshotId()
      • setSnapshotId

        void setSnapshotId​(String id)
      • getObjectTypeName

        String getObjectTypeName()
      • setName

        DatabaseObject setName​(String name)
        Sets the name for the database object.
        Parameters:
        name - the new name for the database object
        Returns:
        a reference to the same object (implementing classes are expected to return a reference to the same object).
      • getSchema

        Schema getSchema()
      • snapshotByDefault

        boolean snapshotByDefault()
      • getAttributes

        Set<String> getAttributes()
        Returns the name of all attributes currently stored for this DatabaseObject.
        Returns:
        the Set of all attribute names
      • getAttribute

        <T> T getAttribute​(String attribute,
                           Class<T> type)
        Retrieves the value of a DatabaseObject's attributes and cast it into the desired type.
        Type Parameters:
        T - the desired type of the value
        Parameters:
        attribute - case-sensitive name of the attribute for which the value will be retrieved
        type - class compatible with the desired type T of the return value
        Returns:
        • if the attribute name exists, and the current value can be cast into the desired class, then the value is returned in the desired form. Note that null is a valid value, too.
        • if the attribute name does not exist, null is returned.
        • if the attribute has a value, but that value cannot be cast into the desired class, a RuntimeException will occur.
      • getAttribute

        <T> T getAttribute​(String attribute,
                           T defaultValue)
        Retrieves the value of a DatabaseObject's attributes and cast it into the desired type.
        Type Parameters:
        T - the desired type of the value
        Parameters:
        attribute - case-sensitive name of the attribute for which the value will be retrieved
        defaultValue - the value to be returned if no value (not even null) is stored for the attribute name in the object.
        Returns:
        • if the attribute name exists, and the current value can be cast into a type compatible with T, then value is returned in the desired form. Note that null is a valid value, too.
        • if the attribute name does not exist, defaultValue is returned.
        • if the attribute has a value, but that value cannot be cast into a type compatible with T, a RuntimeException will occur.
      • setAttribute

        DatabaseObject setAttribute​(String attribute,
                                    Object value)
        Sets a given attribute for this object to the specified value.
        Parameters:
        attribute - case-sensitive name of the attribute
        value - value to be set
        Returns:
        a reference to the same object