Class SchemaObjectType

All Implemented Interfaces:
DiffGenerating<SchemaObjectType>, Cloneable

public class SchemaObjectType extends SchemaItem implements DiffGenerating<SchemaObjectType>
One object type in a SchemaModel.
  • Field Details

    • ITEM_TYPE

      public static final ItemType ITEM_TYPE
      The ItemType that this class represents.
  • Constructor Details

    • SchemaObjectType

      public SchemaObjectType()
  • Method Details

    • getSchemaFields

      public NavigableMap<String,SchemaField> getSchemaFields()
      Get this object type's SchemaFields, indexed by name.
      Returns:
      fields in this object type
    • getSchemaCompositeIndexes

      public NavigableMap<String,SchemaCompositeIndex> getSchemaCompositeIndexes()
      Get the SchemaCompositeIndexs defined on this object type's fields, indexed by name.
      Returns:
      composite indexes in this object type
    • getSchemaSalt

      public int getSchemaSalt()
      Get the hash salting value included in the calculation of SchemaSupport.getSchemaId().
      Returns:
      SchemaModel ID hash salting value
    • setSchemaSalt

      public void setSchemaSalt(int schemaSalt)
      Set the hash salting value included in the calculation of SchemaSupport.getSchemaId().
      Parameters:
      schemaSalt - SchemaModel schema ID hash salting value
    • visitSchemaItems

      public void visitSchemaItems(Consumer<? super SchemaItem> visitor)
      Visit all SchemaItem descendents of this instance with the given visitor.

      If this instance is also a SchemaItem, then also visit this instance.

      The traversal is depth first, pre-order.

      Parameters:
      visitor - visitor for schema items
    • getItemType

      public final ItemType getItemType()
      Get the ItemType corresponding to this instance.
      Returns:
      schema item type
    • differencesFrom

      public Diffs differencesFrom(SchemaObjectType that)
      Description copied from interface: DiffGenerating
      Detect the differences of this instance when compared to the given instance.
      Specified by:
      differencesFrom in interface DiffGenerating<SchemaObjectType>
      Parameters:
      that - other instance
      Returns:
      differences; will be empty if there are none detected
    • toString

      public String toString()
      Specified by:
      toString in class SchemaItem
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class SchemaItem
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class SchemaItem
    • clone

      public SchemaObjectType clone()
      Deep-clone this instance.

      The returned instance will not be locked down even if this one is.

      Overrides:
      clone in class SchemaItem
    • visitSchemaItems

      public final <T extends SchemaItem> void visitSchemaItems(Class<T> nodeType, Consumer<? super T> visitor)
      Visit this schema item and all of its descendents matching the given type with the given visitor.

      The traversal is depth first, post-order.

      Parameters:
      nodeType - node type to include
      visitor - visitor for schema items
      Throws:
      IllegalArgumentException - if either parameter is null
    • isLockedDown

      public final boolean isLockedDown(boolean includingStorageIds)
      Determine whether this instance is locked down.
      Parameters:
      includingStorageIds - false to test all but storage ID's, true to require storage ID's to be locked down as well
      Returns:
      true if instance is locked down, otherwise false
    • getSchemaId

      public final SchemaId getSchemaId()
      Generate a unique SchemaId corresponding to the type and encoding structure of this schema item.

      The SchemaId does not depend on the storage ID.

      This instance must be locked down except for storage ID's. Repeated invocations of this method will be very fast, just returning the cached previous result.

      Returns:
      schema ID
      Throws:
      IllegalStateException - if this instance is not locked down
      See Also: