Class IntRange

java.lang.Object
com.yahoo.config.provision.IntRange

public class IntRange extends Object
An integer range.
Author:
bratseth
  • Constructor Details

  • Method Details

    • from

      public OptionalInt from()
      Returns the minimum value which is in this range, or empty if it is open downwards.
    • to

      public OptionalInt to()
      Returns the maximum value which is in this range, or empty if it is open upwards.
    • isEmpty

      public boolean isEmpty()
      Returns true if both from and to is open (not present).
    • includes

      public boolean includes(int value)
      Returns whether the given value is in this range.
    • fit

      public int fit(int value)
      Returns the given value adjusted minimally to fit within this range.
    • equals

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

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

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

      public static IntRange empty()
    • from

      public static IntRange from(int from)
    • to

      public static IntRange to(int to)
    • of

      public static IntRange of(int fromTo)
    • of

      public static IntRange of(int from, int to)
    • fromAtMost

      public IntRange fromAtMost(int minLimit)
      Returns this with a 'from' limit which is at most the given value
    • toAtLeast

      public IntRange toAtLeast(int maxLimit)
      Returns this with a 'to' limit which is at least the given value
    • from

      public static IntRange from(String s)
      Parses a value ("value"), value range ("[min-value?, max-value?]"), or empty.