1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.atlassian.jira.rest.client.api.domain;
18
19 import com.atlassian.jira.rest.client.api.IdentifiableEntity;
20 import com.google.common.base.Objects;
21
22 import java.net.URI;
23
24
25
26
27
28
29 public class SecurityLevel extends AddressableNamedEntity implements IdentifiableEntity<Long> {
30
31 private final Long id;
32 private final String description;
33
34 public SecurityLevel(final URI self, final Long id, final String name, final String description) {
35 super(self, name);
36 this.id = id;
37 this.description = description;
38 }
39
40 @Override
41 public Long getId() {
42 return id;
43 }
44
45 public String getDescription() {
46 return description;
47 }
48
49 @Override
50 public int hashCode() {
51 return Objects.hashCode(super.hashCode(), id, description);
52 }
53
54 @Override
55 public boolean equals(Object obj) {
56 if (obj instanceof SecurityLevel) {
57 final SecurityLevel that = (SecurityLevel) obj;
58 return super.equals(that)
59 && Objects.equal(this.id, that.id)
60 && Objects.equal(this.description, that.description);
61 }
62 return false;
63 }
64
65 @Override
66 protected Objects.ToStringHelper getToStringHelper() {
67 return super.getToStringHelper()
68 .add("id", id)
69 .add("description", description);
70 }
71 }