diff options
Diffstat (limited to 'java/com/google/gerrit/entities/SubmitRequirement.java')
-rw-r--r-- | java/com/google/gerrit/entities/SubmitRequirement.java | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/java/com/google/gerrit/entities/SubmitRequirement.java b/java/com/google/gerrit/entities/SubmitRequirement.java index 13e0b53449..523b993c98 100644 --- a/java/com/google/gerrit/entities/SubmitRequirement.java +++ b/java/com/google/gerrit/entities/SubmitRequirement.java @@ -1,25 +1,37 @@ -// Copyright (C) 2021 The Android Open Source Project +// Copyright (C) 2021 The Android Open Source Project // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package com.google.gerrit.entities; import com.google.auto.value.AutoValue; +import com.google.gerrit.extensions.annotations.ExtensionPoint; import com.google.gson.Gson; import com.google.gson.TypeAdapter; import java.util.Optional; -/** Entity describing a requirement that should be met for a change to become submittable. */ +/** + * Entity describing a requirement that should be met for a change to become submittable. + * + * <p>There are two ways to contribute {@link SubmitRequirement}: + * + * <ul> + * <li>Set per-project in project.config (see {@link + * com.google.gerrit.server.project.ProjectState#getSubmitRequirements()} + * <li>Bind a global {@link SubmitRequirement} that will be evaluated for all projects. + * </ul> + */ +@ExtensionPoint @AutoValue public abstract class SubmitRequirement { /** Requirement name. */ @@ -32,7 +44,7 @@ public abstract class SubmitRequirement { * Expression of the condition that makes the requirement applicable. The expression should be * evaluated for a specific {@link Change} and if it returns false, the requirement becomes * irrelevant for the change (i.e. {@link #submittabilityExpression()} and {@link - * #overrideExpression()} become irrelevant). + * #overrideExpression()} are not evaluated). * * <p>An empty {@link Optional} indicates that the requirement is applicable for any change. */ @@ -56,7 +68,12 @@ public abstract class SubmitRequirement { /** * Boolean value indicating if the {@link SubmitRequirement} definition can be overridden in child - * projects. Default is false. + * projects. + * + * <p>For globally bound {@link SubmitRequirement}, indicates if can be overridden by {@link + * SubmitRequirement} in project.config. + * + * <p>Default is false. */ public abstract boolean allowOverrideInChildProjects(); |