Class PermissionRange

java.lang.Object
com.google.gerrit.entities.PermissionRange
All Implemented Interfaces:
Comparable<PermissionRange>
Direct Known Subclasses:
PermissionRange.WithDefaults

public class PermissionRange extends Object implements Comparable<PermissionRange>
Represents a closed interval [min, max] with a name. The special value [0, 0] is understood to be the empty range.
  • Field Details

    • name

      protected String name
    • min

      protected int min
    • max

      protected int max
  • Constructor Details

    • PermissionRange

      protected PermissionRange()
    • PermissionRange

      public PermissionRange(String name, int min, int max)
  • Method Details

    • getName

      public String getName()
    • isLabel

      public boolean isLabel()
    • getLabel

      public String getLabel()
    • getMin

      public int getMin()
    • getMax

      public int getMax()
    • contains

      public boolean contains(int value)
      True if the value is within the range.
    • squash

      public int squash(int value)
      Normalize the value to fit within the bounds of the range.
    • isEmpty

      public boolean isEmpty()
      True both getMin() and getMax() are 0.
    • compareTo

      public int compareTo(PermissionRange o)
      Specified by:
      compareTo in interface Comparable<PermissionRange>
    • toString

      public String toString()
      Overrides:
      toString in class Object