Class Range

java.lang.Object
org.apache.pulsar.client.api.Range
All Implemented Interfaces:
Comparable<Range>

@Public @Stable public class Range extends Object implements Comparable<Range>
Int range.
  • Constructor Details

    • Range

      public Range(int start, int end)
  • Method Details

    • of

      public static Range of(int start, int end)
    • getStart

      public int getStart()
    • getEnd

      public int getEnd()
    • intersect

      public Range intersect(Range 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
    • compareTo

      public int compareTo(Range o)
      Specified by:
      compareTo in interface Comparable<Range>
    • contains

      public boolean contains(int value)
      Check if the value is in the range.
      Parameters:
      value -
      Returns:
      true if the value is in the range.
    • contains

      public boolean contains(Range otherRange)
      Check if the range is fully contained in the other range.
      Parameters:
      otherRange -
      Returns:
      true if the range is fully contained in the other range.
    • size

      public int size()
      Get the size of the range.
      Returns:
      the size of the range.