Line data Source code
1 : // Copyright (C) 2016 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 : package com.google.gerrit.extensions.api.access; 15 : 16 : import java.util.Objects; 17 : 18 : public class PermissionRuleInfo { 19 146 : public enum Action { 20 146 : ALLOW, 21 146 : DENY, 22 146 : BLOCK, 23 146 : INTERACTIVE, 24 146 : BATCH 25 : } 26 : 27 : public Action action; 28 : public Boolean force; 29 : public Integer min; 30 : public Integer max; 31 : 32 7 : public PermissionRuleInfo(Action action, Boolean force) { 33 7 : this.action = action; 34 7 : this.force = force; 35 7 : } 36 : 37 : @Override 38 : public boolean equals(Object obj) { 39 1 : if (obj instanceof PermissionRuleInfo) { 40 1 : PermissionRuleInfo p = (PermissionRuleInfo) obj; 41 1 : return Objects.equals(action, p.action) 42 1 : && Objects.equals(force, p.force) 43 1 : && Objects.equals(min, p.min) 44 1 : && Objects.equals(max, p.max); 45 : } 46 0 : return false; 47 : } 48 : 49 : @Override 50 : public int hashCode() { 51 0 : return Objects.hash(action, force, min, max); 52 : } 53 : }