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.NamedEntity;
20 import com.google.common.base.Objects;
21
22
23
24
25
26
27 public class Field implements NamedEntity {
28 private final String id;
29
30 private final String name;
31
32 private final String type;
33
34 private final Object value;
35
36 public Field(String id, String name, String type, Object value) {
37 this.id = id;
38 this.name = name;
39 this.type = type;
40 this.value = value;
41 }
42
43 public String getId() {
44 return id;
45 }
46
47 public String getName() {
48 return name;
49 }
50
51 public String getType() {
52 return type;
53 }
54
55 public Object getValue() {
56 return value;
57 }
58
59 @Override
60 public String toString() {
61 return Objects.toStringHelper(this).
62 add("id", id).
63 add("name", name).
64 add("type", type).
65 add("value", getValue()).
66 toString();
67 }
68
69 @Override
70 public int hashCode() {
71 return Objects.hashCode(id, name, type);
72 }
73
74 @Override
75 public boolean equals(Object obj) {
76 if (obj instanceof Field) {
77 Field that = (Field) obj;
78 return Objects.equal(this.id, that.id)
79 && Objects.equal(this.name, that.name)
80 && Objects.equal(this.type, that.type)
81 && Objects.equal(this.value, that.value);
82 }
83 return false;
84 }
85
86 }