Line data Source code
1 : // Copyright (C) 2017 The Android Open Source Project 2 : // 3 : // Licensed under the Apache License, Version 2.0 (the "License"); 4 : // you may not use this file except in compliance with the License. 5 : // You may obtain a copy of the License at 6 : // 7 : // http://www.apache.org/licenses/LICENSE-2.0 8 : // 9 : // Unless required by applicable law or agreed to in writing, software 10 : // distributed under the License is distributed on an "AS IS" BASIS, 11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 : // See the License for the specific language governing permissions and 13 : // limitations under the License. 14 : 15 : package com.google.gerrit.entities; 16 : 17 : /** 18 : * Contains all inheritable boolean project configs and maps internal representations to API 19 : * objects. 20 : * 21 : * <p>Perform the following steps for adding a new inheritable boolean project config: 22 : * 23 : * <ol> 24 : * <li>Add a field to {@link com.google.gerrit.extensions.api.projects.ConfigInput} 25 : * <li>Add a field to {@link com.google.gerrit.extensions.api.projects.ConfigInfo} 26 : * <li>Add the config to this enum 27 : * <li>Add API mappers to {@link 28 : * com.google.gerrit.server.project.BooleanProjectConfigTransformations} 29 : * </ol> 30 : */ 31 152 : public enum BooleanProjectConfig { 32 152 : USE_CONTRIBUTOR_AGREEMENTS("receive", "requireContributorAgreement"), 33 152 : USE_SIGNED_OFF_BY("receive", "requireSignedOffBy"), 34 152 : USE_CONTENT_MERGE("submit", "mergeContent"), 35 152 : REQUIRE_CHANGE_ID("receive", "requireChangeId"), 36 152 : CREATE_NEW_CHANGE_FOR_ALL_NOT_IN_TARGET("receive", "createNewChangeForAllNotInTarget"), 37 152 : ENABLE_SIGNED_PUSH("receive", "enableSignedPush"), 38 152 : REQUIRE_SIGNED_PUSH("receive", "requireSignedPush"), 39 152 : REJECT_IMPLICIT_MERGES("receive", "rejectImplicitMerges"), 40 152 : PRIVATE_BY_DEFAULT("change", "privateByDefault"), 41 152 : ENABLE_REVIEWER_BY_EMAIL("reviewer", "enableByEmail"), 42 152 : MATCH_AUTHOR_TO_COMMITTER_DATE("submit", "matchAuthorToCommitterDate"), 43 152 : REJECT_EMPTY_COMMIT("submit", "rejectEmptyCommit"), 44 152 : WORK_IN_PROGRESS_BY_DEFAULT("change", "workInProgressByDefault"); 45 : 46 : // Git config 47 : private final String section; 48 : private final String name; 49 : 50 152 : BooleanProjectConfig(String section, String name) { 51 152 : this.section = section; 52 152 : this.name = name; 53 152 : } 54 : 55 : public String getSection() { 56 151 : return section; 57 : } 58 : 59 : public String getSubSection() { 60 151 : return null; 61 : } 62 : 63 : public String getName() { 64 151 : return name; 65 : } 66 : }