Interface HasComparableOperators<ENTITY,V extends Comparable<? super V>>
- Type Parameters:
ENTITY- the entity typeV- the field value type
- All Superinterfaces:
Comparator<ENTITY>,Field<ENTITY>,HasColumnName,com.speedment.runtime.compute.trait.HasCompare<ENTITY>,HasGetter<ENTITY>,HasTable<ENTITY>
- All Known Subinterfaces:
ByteField<ENTITY>,CharField<ENTITY>,ComparableField<ENTITY,,V> DoubleField<ENTITY>,EnumField<ENTITY,,E> FloatField<ENTITY>,IntField<ENTITY>,LongField<ENTITY>,ShortField<ENTITY>,StringField<ENTITY>
Integer and not int) and that implements Comparable.- Since:
- 2.2.0
- Author:
- Per Minborg, Emil Forslund
-
Method Summary
Modifier and TypeMethodDescriptiondefault SpeedmentPredicate<ENTITY>Returns aPredicatethat will evaluate totrue, if and only if this Field is between the given values (exclusive the start value and the end value).Returns aPredicatethat will evaluate totrue, if and only if this Field is between the given values and taking the Inclusion parameter into account when determining if either of the end points shall be included in the Field range or not.Returns aComparatorthat will compare to this field using this fields natural order, null fields are sorted last.Returns aComparatorthat will compare to this field using this fields natural order, null fields are sorted first.Returns aPredicatethat will evaluate totrue, if and only if this Field is equal to the given value.greaterOrEqual(V value) Returns aPredicatethat will evaluate totrue, if and only if this Field is greater than or equal to the given value.greaterThan(V value) Returns aPredicatethat will evaluate totrue, if and only if this Field is greater than the given value.in(Collection<V> values) Returns aPredicatethat will evaluate totrue, if and only if this Field is in the given set.default SpeedmentPredicate<ENTITY>Returns aPredicatethat will evaluate totrue, if and only if this Field is in the set of given values.lessOrEqual(V value) Returns aPredicatethat will evaluate totrue, if and only if this Field is less than or equal to the given value.Returns aPredicatethat will evaluate totrue, if and only if this Field is less than the given value.default SpeedmentPredicate<ENTITY>notBetween(V start, V end) Returns aPredicatethat will evaluate totrue, if and only if this Field is not between the given values (exclusive the start value and the end value).notBetween(V start, V end, Inclusion inclusion) Returns aPredicatethat will evaluate totrue, if and only if this Field is not between the given values and taking the Inclusion parameter into account when determining if either of the end points shall be included in the Field range or not.Returns aPredicatethat will evaluate totrue, if and only if this Field is not equal to the given value.notIn(Collection<V> values) Returns aPredicatethat will evaluate totrue, if and only if this Field is not in the given Set.default SpeedmentPredicate<ENTITY>Returns aPredicatethat will evaluate totrue, if and only if this Field is not in the set of given values.default Comparator<ENTITY>reversed()default Comparator<ENTITY>thenComparing(Comparator<? super ENTITY> other) default <U extends Comparable<? super U>>
Comparator<ENTITY>thenComparing(Function<? super ENTITY, ? extends U> keyExtractor) default <U> Comparator<ENTITY>thenComparing(Function<? super ENTITY, ? extends U> keyExtractor, Comparator<? super U> keyComparator) default Comparator<ENTITY>thenComparingDouble(ToDoubleFunction<? super ENTITY> keyExtractor) default Comparator<ENTITY>thenComparingInt(ToIntFunction<? super ENTITY> keyExtractor) default Comparator<ENTITY>thenComparingLong(ToLongFunction<? super ENTITY> keyExtractor) Methods inherited from interface java.util.Comparator
equalsMethods inherited from interface com.speedment.jpastreamer.field.trait.HasColumnName
columnNameMethods inherited from interface com.speedment.runtime.compute.trait.HasCompare
compare
-
Method Details
-
comparator
FieldComparator<ENTITY> comparator()Returns aComparatorthat will compare to this field using this fields natural order, null fields are sorted last.- Returns:
- a
Comparatorthat will compare to this field using this fields natural order, null fields are sorted last.
-
comparatorNullFieldsFirst
FieldComparator<ENTITY> comparatorNullFieldsFirst()Returns aComparatorthat will compare to this field using this fields natural order, null fields are sorted first.- Returns:
- a
Comparatorthat will compare to this field using this fields natural order, null fields are sorted first
-
equal
Returns aPredicatethat will evaluate totrue, if and only if this Field is equal to the given value.- Parameters:
value- to compare- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is equal to the given value
-
notEqual
Returns aPredicatethat will evaluate totrue, if and only if this Field is not equal to the given value.- Parameters:
value- to compare- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is not equal to the given value
-
lessThan
Returns aPredicatethat will evaluate totrue, if and only if this Field is less than the given value.If the specified value is
null, the returned predicate will always returnfalse.- Parameters:
value- to compare- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is less than the given value
-
lessOrEqual
Returns aPredicatethat will evaluate totrue, if and only if this Field is less than or equal to the given value.If the specified value is
null, the returned predicate will only returntruefornullvalues.- Parameters:
value- to compare- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is less than or equal to the given value
-
greaterThan
Returns aPredicatethat will evaluate totrue, if and only if this Field is greater than the given value. If the specified value isnull, the returned predicate will always returnfalse.- Parameters:
value- to compare- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is greater than the given value
-
greaterOrEqual
Returns aPredicatethat will evaluate totrue, if and only if this Field is greater than or equal to the given value.If the specified value is
null, the returned predicate will only returntruefornullvalues.- Parameters:
value- to compare- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is greater than or equal to the given value
-
between
Returns aPredicatethat will evaluate totrue, if and only if this Field is between the given values (exclusive the start value and the end value).N.B. if the start value is greater or equal to the end value, then the returned Predicate will always evaluate to
false.- Parameters:
start- to compare as a start valueend- to compare as an end value- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is between the given values (exclusive the start value and the end value)
-
between
Returns aPredicatethat will evaluate totrue, if and only if this Field is between the given values and taking the Inclusion parameter into account when determining if either of the end points shall be included in the Field range or not.N.B. if the start value is greater than the end value, then the returned Predicate will always evaluate to
false- Parameters:
start- to compare as a start valueend- to compare as an end valueinclusion- determines if the end points is included in the Field range.- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is between the given values and taking the Inclusion parameter into account when determining if either of the end points shall be included in the Field range or not
-
notBetween
Returns aPredicatethat will evaluate totrue, if and only if this Field is not between the given values (exclusive the start value and the end value).N.B. if the start value is greater than the end value, then the returned Predicate will always evaluate to
true- Parameters:
start- to compare as a start valueend- to compare as an end value- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is not between the given values (exclusive the start value and the end value)
-
notBetween
Returns aPredicatethat will evaluate totrue, if and only if this Field is not between the given values and taking the Inclusion parameter into account when determining if either of the end points shall be included in the Field range or not.N.B. if the start value is greater than the end value, then the returned Predicate will always evaluate to
true- Parameters:
start- to compare as a start valueend- to compare as an end valueinclusion- determines if the end points is included in the Field range.- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is not between the given values and taking the Inclusion parameter into account when determining if either of the end points shall be included in the Field range or not
-
in
Returns aPredicatethat will evaluate totrue, if and only if this Field is in the set of given values.N.B. if no values are given, then the returned Predicate will always evaluate to
false- Parameters:
values- the set of values to match towards this Field- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is in the set of given values
-
in
Returns aPredicatethat will evaluate totrue, if and only if this Field is in the given set. (If the collection is not a set, then a set will be created temporarily from the values of the collection).N.B. if the Set is empty, then the returned Predicate will always evaluate to
false- Parameters:
values- the set of values to match towards this Field- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is in the given Set
-
notIn
Returns aPredicatethat will evaluate totrue, if and only if this Field is not in the set of given values.N.B. if no values are given, then the returned Predicate will always evaluate to
true- Parameters:
values- the set of values to match towards this Field- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is not in the set of given values
-
notIn
Returns aPredicatethat will evaluate totrue, if and only if this Field is not in the given Set. (If the collection is not a set, then a set will be created temporarily from the values of the collection).N.B. if the Set is empty, then the returned Predicate will always evaluate to
true- Parameters:
values- the set of values to match towards this Field- Returns:
- a Predicate that will evaluate to
true, if and only if this Field is not in the given Set
-
reversed
- Specified by:
reversedin interfaceComparator<ENTITY>
-
thenComparing
- Specified by:
thenComparingin interfaceComparator<ENTITY>
-
thenComparing
default <U> Comparator<ENTITY> thenComparing(Function<? super ENTITY, ? extends U> keyExtractor, Comparator<? super U> keyComparator) - Specified by:
thenComparingin interfaceComparator<ENTITY>
-
thenComparing
default <U extends Comparable<? super U>> Comparator<ENTITY> thenComparing(Function<? super ENTITY, ? extends U> keyExtractor) - Specified by:
thenComparingin interfaceComparator<ENTITY>
-
thenComparingInt
- Specified by:
thenComparingIntin interfaceComparator<ENTITY>
-
thenComparingLong
- Specified by:
thenComparingLongin interfaceComparator<ENTITY>
-
thenComparingDouble
- Specified by:
thenComparingDoublein interfaceComparator<ENTITY>
-