Class ClosedOpenRange


  • @Beta
    public final class ClosedOpenRange
    extends java.lang.Object
    Represent a closed-open range. The primary user of this class is the ResourceService implementation.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      int lowerBound()
      Returns the lower bound.
      static ClosedOpenRange of​(int lowerBound, int upperBound)
      Create a range with a lower bound and an upper bound.
      static ClosedOpenRange of​(com.google.common.collect.Range<java.lang.Integer> range)
      Creates a range from a Guava's range.
      java.lang.String toString()  
      int upperBound()
      Returns the upper bound.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • of

        public static ClosedOpenRange of​(com.google.common.collect.Range<java.lang.Integer> range)
        Creates a range from a Guava's range.
        Parameters:
        range - Guava's range
        Returns:
        this range
      • of

        public static ClosedOpenRange of​(int lowerBound,
                                         int upperBound)
        Create a range with a lower bound and an upper bound.
        Parameters:
        lowerBound - lower bound (inclusive)
        upperBound - upper bound (exclusive)
        Returns:
        this range
      • lowerBound

        public int lowerBound()
        Returns the lower bound.
        Returns:
        the lower bound
      • upperBound

        public int upperBound()
        Returns the upper bound.
        Returns:
        the upper bound
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object