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

Last change on this file since 1282 was 1116, checked in by wouter, 3 months ago

#363 small cleanup in test code

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