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.AddressableEntity;
20 import com.atlassian.jira.rest.client.api.IdentifiableEntity;
21 import com.google.common.base.Objects;
22
23 import java.net.URI;
24
25
26
27
28
29
30 public class BasicIssue implements AddressableEntity, IdentifiableEntity<Long> {
31 private final URI self;
32
33 private final String key;
34 private final Long id;
35
36 public BasicIssue(URI self, String key, Long id) {
37 this.self = self;
38 this.key = key;
39 this.id = id;
40 }
41
42
43
44
45 @Override
46 public URI getSelf() {
47 return self;
48 }
49
50
51
52
53 public String getKey() {
54 return key;
55 }
56
57
58
59
60 @Override
61 public Long getId() {
62 return id;
63 }
64
65 @Override
66 public String toString() {
67 return getToStringHelper().toString();
68 }
69
70 protected Objects.ToStringHelper getToStringHelper() {
71 return Objects.toStringHelper(this).
72 add("self", self).
73 add("key", key).
74 add("id", id);
75 }
76
77 @Override
78 public boolean equals(Object obj) {
79 if (obj instanceof BasicIssue) {
80 BasicIssue that = (BasicIssue) obj;
81 return Objects.equal(this.self, that.self)
82 && Objects.equal(this.key, that.key)
83 && Objects.equal(this.id, that.id);
84 }
85 return false;
86 }
87
88 @Override
89 public int hashCode() {
90 return Objects.hashCode(self, key, id);
91 }
92
93 }