public interface IIndex
-
Method Summary
Modifier and TypeMethodDescriptionRetrieve the item from the index that matches the provided key.Retrieve the key field components used to generate a key for this index.static booleanisAllNulls(Iterable<String> key) Check if a key contains information other thannullStrings.static IIndexnewInstance(List<? extends IKeyField> keyFields) Construct a new index using the provided key field components to generate keys.Store the provided item using the provided key.toKey(INodeItem item, List<? extends IKeyField> keyFields, DynamicContext dynamicContext) Construct a key by evaluating the provided key field components against the provided item.
-
Method Details
-
newInstance
Construct a new index using the provided key field components to generate keys.- Parameters:
keyFields- the key field components to use to generate keys by default- Returns:
- the new index
-
isAllNulls
Check if a key contains information other thannullStrings.- Parameters:
key- the key to check- Returns:
trueif the series of key values contains onlynullvalues, orfalseotherwise
-
getKeyFields
Retrieve the key field components used to generate a key for this index.- Returns:
- the key field components
-
put
Store the provided item using the provided key.- Parameters:
item- the item to storekey- the key to store the item with- Returns:
- the previous item stored in the index using the key, or
nullotherwise
-
get
Retrieve the item from the index that matches the provided key.- Parameters:
key- the key to use for lookup- Returns:
- the item with the matching key or
nullif no matching item was found
-
toKey
@NonNull static List<String> toKey(@NonNull INodeItem item, @NonNull List<? extends IKeyField> keyFields, @NonNull DynamicContext dynamicContext) Construct a key by evaluating the provided key field components against the provided item.- Parameters:
item- the item to generate the key fromkeyFields- the key field components used to generate the keydynamicContext- the Metapath evaluation context- Returns:
- a new key
- Throws:
IllegalArgumentException- if a key field has a configured pattern that fails to match the key item value or if the pattern is malformedMetapathException- if the evaluation of a key field's metapath resulted in an unexpected error
-