1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.atlassian.jira.rest.client.domain;
18
19 import com.atlassian.jira.rest.client.AddressableEntity;
20 import com.google.common.base.Objects;
21
22 import java.net.URI;
23
24
25
26
27
28
29 public class BasicIssue implements AddressableEntity {
30 private final URI self;
31
32 private final String key;
33
34 public BasicIssue(URI self, String key) {
35 this.self = self;
36 this.key = key;
37 }
38
39
40
41
42 @Override
43 public URI getSelf() {
44 return self;
45 }
46
47
48
49
50 public String getKey() {
51 return key;
52 }
53
54 @Override
55 public String toString() {
56 return Objects.toStringHelper(this).
57 add("self", self).
58 add("key", key).
59 toString();
60 }
61
62 @Override
63 public boolean equals(Object obj) {
64 if (obj instanceof BasicIssue) {
65 BasicIssue that = (BasicIssue) obj;
66 return Objects.equal(this.self, that.self)
67 && Objects.equal(this.key, that.key);
68 }
69 return false;
70 }
71
72 @Override
73 public int hashCode() {
74 return Objects.hashCode(self, key);
75 }
76
77 }