Class Range.Bound<T>

java.lang.Object
org.springframework.data.domain.Range.Bound<T>
Enclosing class:
Range<T>

public static final class Range.Bound<T> extends Object
Value object representing a boundary. A boundary can either be unbounded, including its value or its value.
Since:
2.0
Author:
Mark Paluch
  • Method Details

    • unbounded

      public static <T> Range.Bound<T> unbounded()
      Creates an unbounded Range.Bound.
    • isBounded

      public boolean isBounded()
      Returns whether this boundary is bounded.
      Returns:
    • inclusive

      public static <T> Range.Bound<T> inclusive(T value)
      Creates a boundary including value.
      Parameters:
      value - must not be null.
      Returns:
    • inclusive

      public static Range.Bound<Integer> inclusive(int value)
      Creates a boundary including value.
      Parameters:
      value - must not be null.
      Returns:
    • inclusive

      public static Range.Bound<Long> inclusive(long value)
      Creates a boundary including value.
      Parameters:
      value - must not be null.
      Returns:
    • inclusive

      public static Range.Bound<Float> inclusive(float value)
      Creates a boundary including value.
      Parameters:
      value - must not be null.
      Returns:
    • inclusive

      public static Range.Bound<Double> inclusive(double value)
      Creates a boundary including value.
      Parameters:
      value - must not be null.
      Returns:
    • exclusive

      public static <T> Range.Bound<T> exclusive(T value)
      Creates a boundary excluding value.
      Parameters:
      value - must not be null.
      Returns:
    • exclusive

      public static Range.Bound<Integer> exclusive(int value)
      Creates a boundary excluding value.
      Parameters:
      value - must not be null.
      Returns:
    • exclusive

      public static Range.Bound<Long> exclusive(long value)
      Creates a boundary excluding value.
      Parameters:
      value - must not be null.
      Returns:
    • exclusive

      public static Range.Bound<Float> exclusive(float value)
      Creates a boundary excluding value.
      Parameters:
      value - must not be null.
      Returns:
    • exclusive

      public static Range.Bound<Double> exclusive(double value)
      Creates a boundary excluding value.
      Parameters:
      value - must not be null.
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getValue

      public Optional<T> getValue()
    • isInclusive

      public boolean isInclusive()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • map

      public <R> Range.Bound<R> map(Function<? super T,? extends R> mapper)
      Apply a mapping Function to the boundary value.
      Type Parameters:
      R -
      Parameters:
      mapper - must not be null. If the mapper returns null, then the boundary value corresponds with unbounded().
      Returns:
      a new Range.Bound after applying the value to the mapper.
      Since:
      3.0