Interface Assertion


  • public interface Assertion
    A compiled attribute value assertion.
    • Field Detail

      • UNDEFINED_ASSERTION

        static final Assertion UNDEFINED_ASSERTION
        An assertion that always return UNDEFINED for matches and that creates a match all query.
    • Method Detail

      • lessThanAssertion

        static Assertion lessThanAssertion​(String indexId,
                                           ByteSequence normalizedAssertionValue)
        Returns an assertion for less than comparisons.
        Parameters:
        indexId - the index id
        normalizedAssertionValue - the normalized assertion value
        Returns:
        an assertion for less than comparisons.
      • lessOrEqualAssertion

        static Assertion lessOrEqualAssertion​(String indexId,
                                              ByteSequence normalizedAssertionValue)
        Returns an assertion for less than or equal comparisons.
        Parameters:
        indexId - the index id
        normalizedAssertionValue - the normalized assertion value
        Returns:
        an assertion for less than or equal comparisons.
      • greaterOrEqualAssertion

        static Assertion greaterOrEqualAssertion​(String indexId,
                                                 ByteSequence normalizedAssertionValue)
        Returns an assertion for greater than or equal comparisons.
        Parameters:
        indexId - the index id
        normalizedAssertionValue - the normalized assertion value
        Returns:
        an assertion for greater than or equal comparisons.
      • greaterThanAssertion

        static Assertion greaterThanAssertion​(String indexId,
                                              ByteSequence normalizedAssertionValue)
        Returns an assertion for greater than comparisons.
        Parameters:
        indexId - the index id
        normalizedAssertionValue - the normalized assertion value
        Returns:
        an assertion for greater than comparisons.
      • matches

        ConditionResult matches​(ByteSequence normalizedAttributeValue)
        Indicates whether the provided attribute value should be considered a match for this assertion value according to the matching rule.
        Parameters:
        normalizedAttributeValue - The normalized attribute value.
        Returns:
        TRUE if the attribute value should be considered a match for the provided assertion value, FALSE if it does not match, or UNDEFINED if the result is undefined.
      • matchesAny

        default ConditionResult matchesAny​(Set<? extends ByteSequence> normalizedAttributeValues)
        Indicates whether the provided attribute values should be considered a match for this assertion value according to the matching rule.
        Parameters:
        normalizedAttributeValues - The normalized attribute values.
        Returns:
        TRUE if the attribute value should be considered a match for the provided assertion value, FALSE if it does not match, or UNDEFINED if the result is undefined.
      • createIndexQuery

        <T> T createIndexQuery​(AttributeDescription attributeDescription,
                               IndexQueryFactory<T> factory)
                        throws DecodeException
        Returns an index query appropriate for the provided attribute value assertion.
        Type Parameters:
        T - The type of index query created by the factory.
        Parameters:
        attributeDescription - The attribute description whose index should be queried.
        factory - The index query factory which should be used to construct the index query.
        Returns:
        The index query appropriate for the provided attribute value assertion.
        Throws:
        DecodeException - If an error occurs while generating the index query.