1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.atlassian.jira.rest.client.internal.json;
18
19 import com.google.common.base.Objects;
20
21 import javax.annotation.Nullable;
22
23
24
25
26
27
28 public class FieldSchema {
29
30 private final String type;
31 @Nullable
32 private final String items;
33 @Nullable
34 private final String system;
35 @Nullable
36 private final String custom;
37 @Nullable
38 private final Long customId;
39
40 public FieldSchema(String type, String items, String system, String custom, Long customId) {
41 this.type = type;
42 this.items = items;
43 this.system = system;
44 this.custom = custom;
45 this.customId = customId;
46 }
47
48 public String getType() {
49 return type;
50 }
51
52 @Nullable
53 public String getItems() {
54 return items;
55 }
56
57 @Nullable
58 public String getSystem() {
59 return system;
60 }
61
62 @Nullable
63 public String getCustom() {
64 return custom;
65 }
66
67 @Nullable
68 public Long getCustomId() {
69 return customId;
70 }
71
72 public boolean isCustom() {
73 return custom != null;
74 }
75
76
77
78
79
80
81 protected Objects.ToStringHelper getToStringHelper() {
82 return Objects.toStringHelper(this).
83 add("type", type).
84 add("items", items).
85 add("system", system).
86 add("custom", custom).
87 add("customId", customId);
88 }
89
90 @Override
91 public String toString() {
92 return getToStringHelper().toString();
93 }
94
95 @Override
96 public boolean equals(Object obj) {
97 if (obj instanceof FieldSchema) {
98 FieldSchema that = (FieldSchema) obj;
99 return Objects.equal(this.type, that.type)
100 && Objects.equal(this.items, that.items)
101 && Objects.equal(this.system, that.system)
102 && Objects.equal(this.custom, that.custom)
103 && Objects.equal(this.customId, that.customId);
104 }
105 return false;
106 }
107
108 @Override
109 public int hashCode() {
110 return Objects.hashCode(type, items, system, custom, customId);
111 }
112 }