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 javax.annotation.Nullable;
23 import java.net.URI;
24
25
26
27
28
29
30 public class BasicComponent implements AddressableEntity {
31 private final URI self;
32 private final String name;
33 @Nullable
34 private final String description;
35
36 public BasicComponent(URI self, String name, String description) {
37 this.self = self;
38 this.name = name;
39 this.description = description;
40 }
41
42 @Override
43 public URI getSelf() {
44 return self;
45 }
46
47 public String getName() {
48 return name;
49 }
50
51
52
53
54 @Nullable
55 public String getDescription() {
56 return description;
57 }
58
59 @Override
60 public String toString() {
61 return Objects.toStringHelper(this).
62 add("self", self).
63 add("name", name).
64 add("description", description).
65 toString();
66 }
67
68 @Override
69 public boolean equals(Object obj) {
70 if (obj instanceof BasicComponent) {
71 BasicComponent that = (BasicComponent) obj;
72 return Objects.equal(this.self, that.self)
73 && Objects.equal(this.name, that.name)
74 && Objects.equal(this.description, that.description);
75 }
76 return false;
77 }
78
79 @Override
80 public int hashCode() {
81 return Objects.hashCode(self, name, description);
82 }
83
84 }