public enum LabelFunction extends java.lang.Enum<LabelFunction>
Only describes built-in label functions. Admins can extend the logic arbitrarily using Prolog rules, in which case the choice of function in the project config is ignored.
Function semantics are documented in config-labels.txt
, and actual behavior is
implemented both in Prolog in gerrit_common.pl
and in the check(com.google.gerrit.common.data.LabelType, java.lang.Iterable<com.google.gerrit.reviewdb.client.PatchSetApproval>)
method.
Enum Constant and Description |
---|
ANY_WITH_BLOCK |
MAX_NO_BLOCK |
MAX_WITH_BLOCK |
NO_BLOCK |
NO_OP |
PATCH_SET_LOCK |
Modifier and Type | Field and Description |
---|---|
static java.util.Map<java.lang.String,LabelFunction> |
ALL |
Modifier and Type | Method and Description |
---|---|
SubmitRecord.Label |
check(LabelType labelType,
java.lang.Iterable<PatchSetApproval> approvals) |
java.lang.String |
getFunctionName()
The function name as defined in documentation and
project.config . |
boolean |
isBlock()
Whether the label is a "block" label, meaning a minimum vote will prevent submission.
|
boolean |
isMaxValueRequired()
Whether the label requires a vote with the maximum value to allow submission.
|
boolean |
isRequired()
Whether the label is a mandatory label, meaning absence of votes will prevent submission.
|
static java.util.Optional<LabelFunction> |
parse(java.lang.String str) |
static LabelFunction |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static LabelFunction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LabelFunction ANY_WITH_BLOCK
public static final LabelFunction MAX_WITH_BLOCK
public static final LabelFunction MAX_NO_BLOCK
public static final LabelFunction NO_BLOCK
public static final LabelFunction NO_OP
public static final LabelFunction PATCH_SET_LOCK
public static final java.util.Map<java.lang.String,LabelFunction> ALL
public static LabelFunction[] values()
for (LabelFunction c : LabelFunction.values()) System.out.println(c);
public static LabelFunction valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static java.util.Optional<LabelFunction> parse(java.lang.String str)
public java.lang.String getFunctionName()
project.config
.public boolean isBlock()
public boolean isRequired()
public boolean isMaxValueRequired()
public SubmitRecord.Label check(LabelType labelType, java.lang.Iterable<PatchSetApproval> approvals)