Interface NitriteIndex


  • public interface NitriteIndex
    The NitriteIndex interface represents an index in Nitrite database. It provides methods to write, remove and find NitriteIds from the index. It also provides methods to drop the index and validate the index field.
    Since:
    4.0
    Author:
    Anindya Chatterjee
    • Method Detail

      • getIndexDescriptor

        IndexDescriptor getIndexDescriptor()
        Gets index descriptor.
        Returns:
        the index descriptor
      • write

        void write​(FieldValues fieldValues)
        Writes the given field values to the index.
        Parameters:
        fieldValues - the field values to write.
      • remove

        void remove​(FieldValues fieldValues)
        Removes the index entry for the specified field values.
        Parameters:
        fieldValues - the field values to remove the index entry for.
      • drop

        void drop()
        Drops the index.
      • findNitriteIds

        LinkedHashSet<NitriteId> findNitriteIds​(FindPlan findPlan)
        Finds the NitriteIds from the index for the given find plan.
        Parameters:
        findPlan - the find plan
        Returns:
        the linked hash set
      • isUnique

        default boolean isUnique()
        Checks if the index is unique.
        Returns:
        true if the index is unique, false otherwise.
      • validateIndexField

        default void validateIndexField​(Object value,
                                        String field)
        Validates the index field.
        Parameters:
        value - the value to be validated.
        field - the name of the field to be validated.
        Throws:
        ValidationException - if the index field is not a comparable type.