Class AbstractLabelPermission

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

public abstract class AbstractLabelPermission extends Object implements ChangePermissionOrLabel
Abstract permission representing a label.
  • Field Details

  • Constructor Details

    • AbstractLabelPermission

      public AbstractLabelPermission(AbstractLabelPermission.ForUser forUser, String name)
      Construct a reference to an abstract label permission.
      Parameters:
      forUser - SELF (default) or ON_BEHALF_OF for labelAs behavior.
      name - name of the label, e.g. "Code-Review" or "Verified".
  • Method Details

    • forUser

      Returns SELF or ON_BEHALF_OF (or labelAs).
    • label

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

      protected abstract String permissionPrefix()
    • permissionName

      protected 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