Line data Source code
1 : // Copyright (C) 2014 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.extensions.client; 16 : 17 152 : public enum ProjectState { 18 : /** Permits reading project state and contents as well as mutating data. */ 19 152 : ACTIVE(true, true), 20 : /** Permits reading project state and contents. Does not permit any modifications. */ 21 152 : READ_ONLY(true, false), 22 : /** 23 : * Hides the project as if it was deleted, but makes requests fail with an error message that 24 : * reveals the project's existence. 25 : */ 26 152 : HIDDEN(false, false); 27 : 28 : private final boolean permitsRead; 29 : private final boolean permitsWrite; 30 : 31 152 : ProjectState(boolean permitsRead, boolean permitsWrite) { 32 152 : this.permitsRead = permitsRead; 33 152 : this.permitsWrite = permitsWrite; 34 152 : } 35 : 36 : public boolean permitsRead() { 37 145 : return permitsRead; 38 : } 39 : 40 : public boolean permitsWrite() { 41 119 : return permitsWrite; 42 : } 43 : }