2 * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.aaa.api.model;
13 * @author peter.mellquist@hp.com
18 import javax.xml.bind.annotation.XmlRootElement;
20 @XmlRootElement(name = "grant")
22 private String grantid;
23 private String domainid;
24 private String userid;
25 private String roleid;
27 public String getGrantid(){
31 public void setGrantid(String id){
35 public String getDomainid() {
39 public void setDomainid(String id) {
43 public String getUserid() {
47 public void setUserid(String id) {
51 public String getRoleid() {
55 public void setRoleid(String id) {
60 public int hashCode() {
61 return this.getUserid().hashCode();
65 public boolean equals(Object obj) {
66 Grant other = (Grant)obj;
69 if(compareValues(getDomainid(), other.getDomainid()) &&
70 compareValues(getRoleid(), other.getRoleid()) &&
71 compareValues(getUserid(), other.getUserid()))
76 private boolean compareValues(Object a,Object b){
77 if(a==null && b!=null)
79 if(a!=null && b==null)
81 if(a==null && b==null)