Interface SpecificationPicker<T,S extends BaseSelector>
-
- Type Parameters:
T- the type of the object the specification applies to.S- the type of the selector.
public interface SpecificationPicker<T,S extends BaseSelector>An element of theSpecificationBuilderDSL to pick the specification that will apply to the current selection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <V extends Comparable<? super V>>
OperatorPicker<T,S>between(V leftValue, V rightValue)Picks a between specification that will be satisfied if the current selection is strictly greater than and strictly less than to the specified value.<V extends Comparable<? super V>>
OperatorPicker<T,S>between(V leftValue, V rightValue, boolean leftInclusive, boolean rightInclusive)Picks a between specification that will be satisfied if the current selection is (strictly or not) greater than and (strictly or not) less than to the specified value.StringOptionPicker<T,S>equalTo(String value)Picks aString-specific equality specification that will be satisfied if the current selection equals to the specified value.<V> OperatorPicker<T,S>equalTo(V value)Picks a general purpose equality specification that will be satisfied if the current selection equals to the specified value.<V extends Comparable<? super V>>
OperatorPicker<T,S>greaterThan(V value)Picks a greater than specification that will be satisfied if the current selection is strictly greater than the specified value.<V extends Comparable<? super V>>
OperatorPicker<T,S>greaterThanOrEqualTo(V value)Picks a greater than or equal to specification that will be satisfied if the current selection is greater than or equal to the specified value.<V extends Comparable<? super V>>
OperatorPicker<T,S>lessThan(V value)Picks a less than specification that will be satisfied if the current selection is strictly less than the specified value.<V extends Comparable<? super V>>
OperatorPicker<T,S>lessThanOrEqualTo(V value)Picks a less than or equal to specification that will be satisfied if the current selection is less than or equal to the specified value.StringOptionPicker<T,S>matching(String pattern)Picks aString-specific matching specification that will be satisfied if the current selection matches the specified pattern.SpecificationPicker<T,S>not()Negates the specification that will be picked.OperatorPicker<T,S>satisfying(Specification<T> specification)Picks a custom specification.
-
-
-
Method Detail
-
not
SpecificationPicker<T,S> not()
Negates the specification that will be picked.- Returns:
- the next operation of the builder DSL, allowing to pick the negated specification.
-
satisfying
OperatorPicker<T,S> satisfying(Specification<T> specification)
Picks a custom specification.- Parameters:
specification- the custom specification.- Returns:
- the next operation of the builder DSL, allowing to combine this specification with another one.
-
matching
StringOptionPicker<T,S> matching(String pattern)
Picks aString-specific matching specification that will be satisfied if the current selection matches the specified pattern. A pattern can contain:- '?' characters which match any character.
- '*' characters which match any (possibly empty) sequence of characters.
- Parameters:
pattern- the pattern to match.- Returns:
- the next operation of the builder DSL, allowing to pick the string matching options.
-
equalTo
StringOptionPicker<T,S> equalTo(String value)
Picks aString-specific equality specification that will be satisfied if the current selection equals to the specified value.- Parameters:
value- the value to be equal to.- Returns:
- the next operation of the builder DSL, allowing to pick the string equality options.
-
equalTo
<V> OperatorPicker<T,S> equalTo(V value)
Picks a general purpose equality specification that will be satisfied if the current selection equals to the specified value.- Type Parameters:
V- the type of the value.- Parameters:
value- the value to be equal to.- Returns:
- the next operation of the builder DSL, allowing to combine this specification with another one.
-
greaterThan
<V extends Comparable<? super V>> OperatorPicker<T,S> greaterThan(V value)
Picks a greater than specification that will be satisfied if the current selection is strictly greater than the specified value.- Type Parameters:
V- the type of the value.- Parameters:
value- the value to be greater than.- Returns:
- the next operation of the builder DSL, allowing to combine this specification with another one.
-
greaterThanOrEqualTo
<V extends Comparable<? super V>> OperatorPicker<T,S> greaterThanOrEqualTo(V value)
Picks a greater than or equal to specification that will be satisfied if the current selection is greater than or equal to the specified value.- Type Parameters:
V- the type of the value.- Parameters:
value- the value to be greater than or equal to.- Returns:
- the next operation of the builder DSL, allowing to combine this specification with another one.
-
lessThan
<V extends Comparable<? super V>> OperatorPicker<T,S> lessThan(V value)
Picks a less than specification that will be satisfied if the current selection is strictly less than the specified value.- Type Parameters:
V- the type of the value.- Parameters:
value- the value to be less than.- Returns:
- the next operation of the builder DSL, allowing to combine this specification with another one.
-
lessThanOrEqualTo
<V extends Comparable<? super V>> OperatorPicker<T,S> lessThanOrEqualTo(V value)
Picks a less than or equal to specification that will be satisfied if the current selection is less than or equal to the specified value.- Type Parameters:
V- the type of the value.- Parameters:
value- the value to be less than or equal to.- Returns:
- the next operation of the builder DSL, allowing to combine this specification with another one.
-
between
<V extends Comparable<? super V>> OperatorPicker<T,S> between(V leftValue, V rightValue)
Picks a between specification that will be satisfied if the current selection is strictly greater than and strictly less than to the specified value.- Type Parameters:
V- the type of the value.- Parameters:
leftValue- the value to be greater than.rightValue- the value to be less than.- Returns:
- the next operation of the builder DSL, allowing to combine this specification with another one.
-
between
<V extends Comparable<? super V>> OperatorPicker<T,S> between(V leftValue, V rightValue, boolean leftInclusive, boolean rightInclusive)
Picks a between specification that will be satisfied if the current selection is (strictly or not) greater than and (strictly or not) less than to the specified value.- Type Parameters:
V- the type of the value.- Parameters:
leftValue- the value to be greater than (or equal to if leftInclusive is true).rightValue- the value to be less than (or equal to if rightInclusive is true).leftInclusive- if true, the leftValue argument will be included in the interval, otherwise it will be excluded.rightInclusive- if true, the rightValue argument will be included in the interval, otherwise it will be excluded.- Returns:
- the next operation of the builder DSL, allowing to combine this specification with another one.
-
-