Class AbstractLabelPermission.WithValue

java.lang.Object
com.google.gerrit.server.permissions.AbstractLabelPermission.WithValue
All Implemented Interfaces:
GerritPermission, ChangePermissionOrLabel
Direct Known Subclasses:
LabelPermission.WithValue, LabelRemovalPermission.WithValue
Enclosing class:
AbstractLabelPermission

public abstract static class AbstractLabelPermission.WithValue extends Object implements ChangePermissionOrLabel
A AbstractLabelPermission at a specific value.
  • Constructor Details

    • WithValue

      public WithValue(AbstractLabelPermission.ForUser forUser, LabelVote label)
      Construct a reference to an abstract label permission at a specific value.
      Parameters:
      forUser - SELF (default) or ON_BEHALF_OF for labelAs behavior.
      label - label name and vote.
  • Method Details

    • forUser

      Returns SELF or ON_BEHALF_OF (or labelAs).
    • label

      public String label()
      Returns name of the label, e.g. "Code-Review".
    • value

      public short value()
      Returns specific value of the label, e.g. 1 or 2.
    • permissionName

      public abstract String permissionName()
    • describeForException

      public final String describeForException()
      Description copied from interface: GerritPermission
      A description in the context of an exception message.

      Should be grammatical when used in the construction "not permitted: [description] on [resource]", although individual PermissionBackend implementations may vary the wording.

      Specified by:
      describeForException in interface GerritPermission
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object other)
      Overrides:
      equals in class Object
    • toString

      public final String toString()
      Overrides:
      toString in class Object