Class EnumArraySchemaField

All Implemented Interfaces:
DiffGenerating<SimpleSchemaField>, Cloneable

public class EnumArraySchemaField extends AbstractEnumSchemaField
An enum array field (of one or more dimensions) in a SchemaObjectType.
  • Field Details

    • ITEM_TYPE

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

    • EnumArraySchemaField

      public EnumArraySchemaField()
  • Method Details

    • getDimensions

      public int getDimensions()
      Get the number of enum array dimensions.
      Returns:
      number of dimensions, a value from 1 to 255
    • setDimensions

      public void setDimensions(int dimensions)
      Set the number of enum array dimensions.
      Parameters:
      dimensions - number of dimensions
      Throws:
      UnsupportedOperationException - if this instance is locked down
    • visit

      public <R> R visit(SchemaFieldSwitch<R> target)
      Description copied from class: SchemaField
      Apply visitor pattern.
      Overrides:
      visit in class SimpleSchemaField
      Type Parameters:
      R - visitor return type
      Parameters:
      target - target to invoke
      Returns:
      value from the method of target corresponding to this instance's type
    • getItemType

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

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

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

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

      public EnumArraySchemaField clone()
      Deep-clone this instance.

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

      Overrides:
      clone in class AbstractEnumSchemaField
    • getObjectType

      public SchemaObjectType getObjectType()
      Get the SchemaObjectType of which this field is a member.
      Returns:
      containing object type
    • setObjectType

      public final void setObjectType(SchemaObjectType objectType)
      Set the SchemaObjectType of which this field is a member.

      Note: this field is considered derived information, and will be set automatically when a referrring SchemaObjectType is locked down.

      Parameters:
      objectType - containing object type
      Throws:
      UnsupportedOperationException - if this instance is locked down
    • 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
      Throws:
      IllegalArgumentException - if visitor is null
    • 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: