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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractLabelPermission.ForUser
static class
AbstractLabelPermission.WithValue
AAbstractLabelPermission
at a specific value.
-
Field Summary
Fields Modifier and Type Field Description protected AbstractLabelPermission.ForUser
forUser
protected String
name
-
Constructor Summary
Constructors Constructor Description AbstractLabelPermission(AbstractLabelPermission.ForUser forUser, String name)
Construct a reference to an abstract label permission.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
describeForException()
A description in the context of an exception message.boolean
equals(Object other)
AbstractLabelPermission.ForUser
forUser()
ReturnsSELF
orON_BEHALF_OF
(or labelAs).int
hashCode()
String
label()
Returns name of the label, e.g.protected String
permissionName()
protected abstract String
permissionPrefix()
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.gerrit.server.permissions.ChangePermissionOrLabel
hintForException
-
-
-
-
Field Detail
-
forUser
protected final AbstractLabelPermission.ForUser forUser
-
name
protected final String name
-
-
Constructor Detail
-
AbstractLabelPermission
public AbstractLabelPermission(AbstractLabelPermission.ForUser forUser, String name)
Construct a reference to an abstract label permission.- Parameters:
forUser
-SELF
(default) orON_BEHALF_OF
for labelAs behavior.name
- name of the label, e.g."Code-Review"
or"Verified"
.
-
-
Method Detail
-
forUser
public AbstractLabelPermission.ForUser forUser()
ReturnsSELF
orON_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 interfaceGerritPermission
-
-