Class AttributeIndex

java.lang.Object
io.superdurable.dex.AttributeIndex

public final class AttributeIndex extends Object
Describes how an Attribute is indexed for Flow search.

Attach an index when defining an Attribute or AttributeMap. The optional index key lets multiple logical Attributes share one physical Dex index when their types match. A null index key uses the Attribute name.

Attribute<String> customer = Attribute.define(
        "customer",
        String.class,
        new AttributeIndex(AttributeIndex.Type.KEYWORD));
  • Constructor Details

    • AttributeIndex

      public AttributeIndex(AttributeIndex.Type type)
      Creates an index using the Attribute name as its search key.
      Parameters:
      type - the index representation; must not be null
      Throws:
      IllegalArgumentException - if type is null
    • AttributeIndex

      public AttributeIndex(AttributeIndex.Type type, String indexKey)
      Creates an index with an explicit physical index key.
      Parameters:
      type - the index representation; must not be null
      indexKey - the physical index key, or null to use the Attribute name
      Throws:
      IllegalArgumentException - if type is null