Package guru.mikelue.jdut.function
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 withDefaultOperatorFactory.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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default OperatorPredicate
and(OperatorPredicate other)
Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another.default Predicate<DatabaseMetaData>
asPredicate()
Turns this predicate toPredicate
.default OperatorPredicate
negate()
Returns a predicate that represents the logical negation of this predicate.default OperatorPredicate
or(OperatorPredicate other)
Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another.boolean
testMetaData(DatabaseMetaData metaData)
Checks the condition by name of operator and meta data of database.
-
-
-
Method Detail
-
asPredicate
default Predicate<DatabaseMetaData> asPredicate()
Turns this predicate toPredicate
.- Returns:
- The predicate with default runtime exception handling
-
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
-
-