10faed2b6c43a4e3ec6363fb861d128727028e50
[aaa.git] / aaa-authn-api / src / main / java / org / opendaylight / aaa / api / model / Role.java
1 /*
2  * Copyright (c) 2014, 2017 Hewlett-Packard Development Company, L.P. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.aaa.api.model;
9
10 import java.util.Objects;
11 import javax.xml.bind.annotation.XmlRootElement;
12
13 @XmlRootElement(name = "role")
14 public class Role {
15     private String roleid;
16     private String name;
17     private String description;
18     private String domainid;
19
20     public String getRoleid() {
21         return roleid;
22     }
23
24     public void setRoleid(String id) {
25         this.roleid = id;
26     }
27
28     public String getName() {
29         return name;
30     }
31
32     public void setName(String name) {
33         this.name = name;
34     }
35
36     public String getDescription() {
37         return description;
38     }
39
40     public void setDescription(String description) {
41         this.description = description;
42     }
43
44     @Override
45     public int hashCode() {
46         return name != null ? name.hashCode() : 0;
47     }
48
49     @Override
50     public boolean equals(Object obj) {
51         if (this == obj) {
52             return true;
53         }
54
55         if (obj == null || getClass() != obj.getClass()) {
56             return false;
57         }
58
59         Role other = (Role) obj;
60         if (Objects.equals(getName(), other.getName()) && Objects.equals(getRoleid(), other.getRoleid())
61                 && Objects.equals(getDescription(), other.getDescription())) {
62             return true;
63         }
64         return false;
65     }
66
67     @Override
68     public String toString() {
69         return name;
70     }
71
72     public void setDomainid(String domainid) {
73         this.domainid = domainid;
74     }
75
76     public String getDomainid() {
77         return this.domainid;
78     }
79 }