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.Map; 17 : import java.util.Objects; 18 : 19 : public class PermissionInfo { 20 : public String label; 21 : public Boolean exclusive; 22 : public Map<String, PermissionRuleInfo> rules; 23 : 24 7 : public PermissionInfo(String label, Boolean exclusive) { 25 7 : this.label = label; 26 7 : this.exclusive = exclusive; 27 7 : } 28 : 29 : @Override 30 : public boolean equals(Object obj) { 31 1 : if (obj instanceof PermissionInfo) { 32 1 : PermissionInfo p = (PermissionInfo) obj; 33 1 : return Objects.equals(label, p.label) 34 1 : && Objects.equals(exclusive, p.exclusive) 35 1 : && Objects.equals(rules, p.rules); 36 : } 37 0 : return false; 38 : } 39 : 40 : @Override 41 : public int hashCode() { 42 0 : return Objects.hash(label, exclusive, rules); 43 : } 44 : }