Interface OperatorPredicate

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface OperatorPredicate
    Used with DefaultOperatorFactory.Builder to check the matching condition for operators of vendor.

    Example:

    
     // dataSource - Initialized instance of data source
     // your_map_of_operators - The map of operators by String key
     OperatorFactory yourFactory = DefaultOperatorFactory.build(
         dataSource,
         builder -> builder
             .add(metaData -> { metaData.getXXX().equals("XXX") }, your_map_of_operators)
     )
     
    • Method Detail

      • and

        default OperatorPredicate and​(OperatorPredicate other)
        Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another. When evaluating the composed predicate, if this predicate is false, then the other predicate is not evaluated.
        Parameters:
        other - a predicate that will be logically-ANDed with this predicate
        Returns:
        A composed predicate
      • or

        default OperatorPredicate or​(OperatorPredicate other)
        Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another. When evaluating the composed predicate, if this predicate is true, then the other predicate is not evaluated.
        Parameters:
        other - a predicate that will be logically-ORed with this predicate
        Returns:
        A composed predicate
      • negate

        default OperatorPredicate negate()
        Returns a predicate that represents the logical negation of this predicate.
        Returns:
        a predicate that represents the logical negation of this predicate
      • testMetaData

        boolean testMetaData​(DatabaseMetaData metaData)
                      throws SQLException
        Checks the condition by name of operator and meta data of database.
        Parameters:
        metaData - The meta data
        Returns:
        true if the condition is matched
        Throws:
        SQLException - The exception to simplify implementation