Interface HasComparableOperators<ENTITY,V extends Comparable<? super V>>

Type Parameters:
ENTITY - the entity type
V - 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>

public interface HasComparableOperators<ENTITY,V extends Comparable<? super V>> extends Field<ENTITY>, com.speedment.runtime.compute.trait.HasCompare<ENTITY>
A representation of an Entity field that is a reference type (e.g. Integer and not int) and that implements Comparable.
Since:
2.2.0
Author:
Per Minborg, Emil Forslund
  • Method Details

    • comparator

      FieldComparator<ENTITY> comparator()
      Returns a Comparator that will compare to this field using this fields natural order, null fields are sorted last.
      Returns:
      a Comparator that will compare to this field using this fields natural order, null fields are sorted last.
    • comparatorNullFieldsFirst

      FieldComparator<ENTITY> comparatorNullFieldsFirst()
      Returns a Comparator that will compare to this field using this fields natural order, null fields are sorted first.
      Returns:
      a Comparator that will compare to this field using this fields natural order, null fields are sorted first
    • equal

      SpeedmentPredicate<ENTITY> equal(V value)
      Returns a Predicate that will evaluate to true, 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

      SpeedmentPredicate<ENTITY> notEqual(V value)
      Returns a Predicate that will evaluate to true, 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

      SpeedmentPredicate<ENTITY> lessThan(V value)
      Returns a Predicate that will evaluate to true, if and only if this Field is less than the given value.

      If the specified value is null, the returned predicate will always return false.

      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

      SpeedmentPredicate<ENTITY> lessOrEqual(V value)
      Returns a Predicate that will evaluate to true, 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 return true for null values.

      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

      SpeedmentPredicate<ENTITY> greaterThan(V value)
      Returns a Predicate that will evaluate to true, if and only if this Field is greater than the given value. If the specified value is null, the returned predicate will always return false.
      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

      SpeedmentPredicate<ENTITY> greaterOrEqual(V value)
      Returns a Predicate that will evaluate to true, 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 return true for null values.

      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

      default SpeedmentPredicate<ENTITY> between(V start, V end)
      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).

      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 value
      end - 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

      SpeedmentPredicate<ENTITY> between(V start, V end, Inclusion inclusion)
      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.

      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 value
      end - to compare as an end value
      inclusion - 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

      default SpeedmentPredicate<ENTITY> notBetween(V start, V end)
      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).

      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 value
      end - 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

      SpeedmentPredicate<ENTITY> notBetween(V start, V end, Inclusion inclusion)
      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.

      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 value
      end - to compare as an end value
      inclusion - 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

      default SpeedmentPredicate<ENTITY> in(V... values)
      Returns a Predicate that will evaluate to true, 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 a Predicate that will evaluate to true, 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

      default SpeedmentPredicate<ENTITY> notIn(V... values)
      Returns a Predicate that will evaluate to true, 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 a Predicate that will evaluate to true, 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

      default Comparator<ENTITY> reversed()
      Specified by:
      reversed in interface Comparator<ENTITY>
    • thenComparing

      default Comparator<ENTITY> thenComparing(Comparator<? super ENTITY> other)
      Specified by:
      thenComparing in interface Comparator<ENTITY>
    • thenComparing

      default <U> Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U> keyExtractor, Comparator<? super U> keyComparator)
      Specified by:
      thenComparing in interface Comparator<ENTITY>
    • thenComparing

      default <U extends Comparable<? super U>> Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U> keyExtractor)
      Specified by:
      thenComparing in interface Comparator<ENTITY>
    • thenComparingInt

      default Comparator<ENTITY> thenComparingInt(ToIntFunction<? super ENTITY> keyExtractor)
      Specified by:
      thenComparingInt in interface Comparator<ENTITY>
    • thenComparingLong

      default Comparator<ENTITY> thenComparingLong(ToLongFunction<? super ENTITY> keyExtractor)
      Specified by:
      thenComparingLong in interface Comparator<ENTITY>
    • thenComparingDouble

      default Comparator<ENTITY> thenComparingDouble(ToDoubleFunction<? super ENTITY> keyExtractor)
      Specified by:
      thenComparingDouble in interface Comparator<ENTITY>