source: java2python/jackson-t/src/test/java/testcode/actions/Bid.java@ 430

Last change on this file since 430 was 404, checked in by wouter, 2 years ago

#122 refactoring, creating separate packages for java core and jackson-translator (jackson-t)

File size: 1018 bytes
Line 
1package testcode.actions;
2
3import com.fasterxml.jackson.annotation.JsonValue;
4
5/**
6 * HACK containing a "Bid" which is just a string here.
7 */
8public final class Bid {
9 private final String value;
10
11 /**
12 *
13 * @param value a simple name, starting with letter, followed by zero or
14 * more letters, digits or _.
15 */
16 public Bid(String value) {
17 this.value = value;
18 }
19
20 @JsonValue
21 public String getValue() {
22 return value;
23 }
24
25 @Override
26 public String toString() {
27 return value;
28 }
29
30 @Override
31 public int hashCode() {
32 final int prime = 31;
33 int result = 1;
34 result = prime * result + ((value == null) ? 0 : value.hashCode());
35 return result;
36 }
37
38 @Override
39 public boolean equals(Object obj) {
40 if (this == obj)
41 return true;
42 if (obj == null)
43 return false;
44 if (getClass() != obj.getClass())
45 return false;
46 Bid other = (Bid) obj;
47 if (value == null) {
48 if (other.value != null)
49 return false;
50 } else if (!value.equals(other.value))
51 return false;
52 return true;
53 }
54
55}
Note: See TracBrowser for help on using the repository browser.