1 package io.oasp.module.security.common.api.accesscontrol;
2
3 import java.io.Serializable;
4 import java.util.Objects;
5
6 import javax.xml.bind.annotation.XmlAccessType;
7 import javax.xml.bind.annotation.XmlAccessorType;
8 import javax.xml.bind.annotation.XmlAttribute;
9 import javax.xml.bind.annotation.XmlID;
10 import javax.xml.bind.annotation.XmlSchemaType;
11 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
12 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
13
14
15
16
17
18
19
20
21 @XmlAccessorType(XmlAccessType.FIELD)
22 public abstract class AccessControl implements Serializable {
23
24
25 private static final long serialVersionUID = 1L;
26
27
28 @XmlID
29 @XmlAttribute(name = "id", required = true)
30 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
31 @XmlSchemaType(name = "NCName")
32 private String id;
33
34
35
36
37 public AccessControl() {
38
39 super();
40 }
41
42
43
44
45
46
47 public AccessControl(String id) {
48
49 super();
50 this.id = id;
51 }
52
53
54
55
56
57 public String getId() {
58
59 return this.id;
60 }
61
62
63
64
65 public void setId(String id) {
66
67 this.id = id;
68 }
69
70 @Override
71 public int hashCode() {
72
73 final int prime = 31;
74 int result = 1;
75 result = prime * result + ((this.id == null) ? 0 : this.id.hashCode());
76 return result;
77 }
78
79 @Override
80 public boolean equals(Object obj) {
81
82 if (this == obj) {
83 return true;
84 }
85 if (obj == null) {
86 return false;
87 }
88 if (getClass() != obj.getClass()) {
89 return false;
90 }
91 AccessControl other = (AccessControl) obj;
92 if (!Objects.equals(this.id, other.id)) {
93 return false;
94 }
95 return true;
96 }
97
98 @Override
99 public String toString() {
100
101 return this.id;
102 }
103
104 }