source: java2python/src/test/java/testcode/actions/Bid.java@ 383

Last change on this file since 383 was 380, checked in by wouter, 2 years ago

#115 work in progress to move zip code to PyProgram and PyModule

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 @JsonValue
10 private final String value;
11
12 /**
13 *
14 * @param value a simple name, starting with letter, followed by zero or
15 * more letters, digits or _.
16 */
17 public Bid(String value) {
18 this.value = value;
19 }
20
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.