Class LabelPermission.WithValue
- java.lang.Object
-
- com.google.gerrit.server.permissions.LabelPermission.WithValue
-
- All Implemented Interfaces:
GerritPermission
,ChangePermissionOrLabel
- Enclosing class:
- LabelPermission
public static class LabelPermission.WithValue extends Object implements ChangePermissionOrLabel
ALabelPermission
at a specific value.
-
-
Constructor Summary
Constructors Constructor Description WithValue(LabelType type, short value)
Construct a reference to a label at a specific value.WithValue(LabelType type, LabelValue value)
Construct a reference to a label at a specific value.WithValue(LabelPermission.ForUser forUser, LabelType type, short value)
Construct a reference to a label at a specific value.WithValue(LabelPermission.ForUser forUser, LabelType type, LabelValue value)
Construct a reference to a label at a specific value.WithValue(LabelPermission.ForUser forUser, LabelVote label)
Construct a reference to a label at a specific value.WithValue(LabelPermission.ForUser forUser, String name, short value)
Construct a reference to a label at a specific value.WithValue(LabelVote label)
Construct a reference to a label at a specific value.WithValue(String name, short value)
Construct a reference to a label at a specific value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
describeForException()
A description in the context of an exception message.boolean
equals(Object other)
LabelPermission.ForUser
forUser()
ReturnsSELF
orON_BEHALF_OF
(or labelAs).int
hashCode()
String
label()
Returns name of the label, e.g.String
toString()
short
value()
Returns specific value of the label, e.g.
-
-
-
Constructor Detail
-
WithValue
public WithValue(LabelType type, LabelValue value)
Construct a reference to a label at a specific value.- Parameters:
type
- description of the label.value
- numeric score assigned to the label.
-
WithValue
public WithValue(LabelType type, short value)
Construct a reference to a label at a specific value.- Parameters:
type
- description of the label.value
- numeric score assigned to the label.
-
WithValue
public WithValue(LabelPermission.ForUser forUser, LabelType type, LabelValue value)
Construct a reference to a label at a specific value.- Parameters:
forUser
-SELF
(default) orON_BEHALF_OF
for labelAs behavior.type
- description of the label.value
- numeric score assigned to the label.
-
WithValue
public WithValue(LabelPermission.ForUser forUser, LabelType type, short value)
Construct a reference to a label at a specific value.- Parameters:
forUser
-SELF
(default) orON_BEHALF_OF
for labelAs behavior.type
- description of the label.value
- numeric score assigned to the label.
-
WithValue
public WithValue(String name, short value)
Construct a reference to a label at a specific value.- Parameters:
name
- name of the label, e.g."Code-Review"
or"Verified"
.value
- numeric score assigned to the label.
-
WithValue
public WithValue(LabelPermission.ForUser forUser, String name, short value)
Construct a reference to a label at a specific value.- Parameters:
forUser
-SELF
(default) orON_BEHALF_OF
for labelAs behavior.name
- name of the label, e.g."Code-Review"
or"Verified"
.value
- numeric score assigned to the label.
-
WithValue
public WithValue(LabelVote label)
Construct a reference to a label at a specific value.- Parameters:
label
- label name and vote.
-
WithValue
public WithValue(LabelPermission.ForUser forUser, LabelVote label)
Construct a reference to a label at a specific value.- Parameters:
forUser
-SELF
(default) orON_BEHALF_OF
for labelAs behavior.label
- label name and vote.
-
-
Method Detail
-
forUser
public LabelPermission.ForUser forUser()
ReturnsSELF
orON_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.
-
describeForException
public 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
-
-