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.google.common.base.Objects;
20
21 import javax.annotation.Nullable;
22 import java.net.URI;
23
24
25
26
27
28
29 public class CustomFieldOption {
30
31 private final URI self;
32 private final Long id;
33 private final String value;
34 private final Iterable<CustomFieldOption> children;
35 @Nullable
36 private final CustomFieldOption child;
37
38 public CustomFieldOption(Long id, URI self, String value, Iterable<CustomFieldOption> children, @Nullable CustomFieldOption child) {
39 this.value = value;
40 this.id = id;
41 this.self = self;
42 this.children = children;
43 this.child = child;
44 }
45
46 public URI getSelf() {
47 return self;
48 }
49
50 public Long getId() {
51 return id;
52 }
53
54 public String getValue() {
55 return value;
56 }
57
58 public Iterable<CustomFieldOption> getChildren() {
59 return children;
60 }
61
62 @Nullable
63 public CustomFieldOption getChild() {
64 return child;
65 }
66
67
68
69
70
71
72 protected Objects.ToStringHelper getToStringHelper() {
73 return Objects.toStringHelper(this)
74 .add("self", self)
75 .add("id", id)
76 .add("value", value)
77 .add("children", children)
78 .add("child", child);
79 }
80
81 @Override
82 public String toString() {
83 return getToStringHelper().toString();
84 }
85
86 @Override
87 public int hashCode() {
88 return Objects.hashCode(self, id, value, children, child);
89 }
90
91 @Override
92 public boolean equals(Object obj) {
93 if (obj == null) {
94 return false;
95 }
96 if (getClass() != obj.getClass()) {
97 return false;
98 }
99 final CustomFieldOption other = (CustomFieldOption) obj;
100 return Objects.equal(this.self, other.self)
101 && Objects.equal(this.id, other.id)
102 && Objects.equal(this.value, other.value)
103 && Objects.equal(this.children, other.children)
104 && Objects.equal(this.child, other.child);
105 }
106 }