Class Range<T>

java.lang.Object
com.blazebit.persistence.view.filter.Range<T>
Type Parameters:
T - The range value type
All Implemented Interfaces:
Serializable

public final class Range<T> extends Object implements Serializable
A range for the value type.
Since:
1.5.0
Author:
Christian Beikov
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> Range<T>
    between(T lowerBound, T upperBound)
    Creates a range for the values between the given lower and upper bound, the given values inclusive.
    static <T> Range<T>
    betweenExclusive(T lowerBound, T upperBound)
    Creates a range for the values between the given lower and upper bound, the given values exclusive.
    static <T> Range<T>
    ge(T lowerBound)
    Creates a range for the values greater or equal than the given value.
    Returns the lower bound, or null if unbounded.
    Returns the upper bound, or null if unbounded.
    static <T> Range<T>
    gt(T lowerBound)
    Creates a range for the values greater than the given value.
    boolean
    Returns whether the bounds are inclusive.
    static <T> Range<T>
    le(T upperBound)
    Creates a range for the values smaller or equal than the given value.
    static <T> Range<T>
    lt(T upperBound)
    Creates a range for the values smaller than the given value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • lt

      public static <T> Range<T> lt(T upperBound)
      Creates a range for the values smaller than the given value.
      Type Parameters:
      T - The value type
      Parameters:
      upperBound - The upper bound
      Returns:
      The range
    • le

      public static <T> Range<T> le(T upperBound)
      Creates a range for the values smaller or equal than the given value.
      Type Parameters:
      T - The value type
      Parameters:
      upperBound - The upper bound
      Returns:
      The range
    • gt

      public static <T> Range<T> gt(T lowerBound)
      Creates a range for the values greater than the given value.
      Type Parameters:
      T - The value type
      Parameters:
      lowerBound - The lower bound
      Returns:
      The range
    • ge

      public static <T> Range<T> ge(T lowerBound)
      Creates a range for the values greater or equal than the given value.
      Type Parameters:
      T - The value type
      Parameters:
      lowerBound - The lower bound
      Returns:
      The range
    • between

      public static <T> Range<T> between(T lowerBound, T upperBound)
      Creates a range for the values between the given lower and upper bound, the given values inclusive.
      Type Parameters:
      T - The value type
      Parameters:
      lowerBound - The lower bound
      upperBound - The upper bound
      Returns:
      The range
    • betweenExclusive

      public static <T> Range<T> betweenExclusive(T lowerBound, T upperBound)
      Creates a range for the values between the given lower and upper bound, the given values exclusive.
      Type Parameters:
      T - The value type
      Parameters:
      lowerBound - The lower bound
      upperBound - The upper bound
      Returns:
      The range
    • getLowerBound

      public T getLowerBound()
      Returns the lower bound, or null if unbounded.
      Returns:
      The lower bound
    • getUpperBound

      public T getUpperBound()
      Returns the upper bound, or null if unbounded.
      Returns:
      The upper bound
    • isInclusive

      public boolean isInclusive()
      Returns whether the bounds are inclusive.
      Returns:
      whether the bounds are inclusive