Rev | Line | |
---|
[505] | 1 | package testcode.actions;
|
---|
| 2 |
|
---|
[1116] | 3 | import org.eclipse.jdt.annotation.NonNull;
|
---|
| 4 |
|
---|
[505] | 5 | import com.fasterxml.jackson.annotation.JsonValue;
|
---|
| 6 |
|
---|
| 7 | /**
|
---|
| 8 | * HACK containing a "Bid" which is just a string here.
|
---|
| 9 | */
|
---|
| 10 | public final class Bid {
|
---|
[1116] | 11 | private final @NonNull String value;
|
---|
[505] | 12 |
|
---|
| 13 | /**
|
---|
| 14 | *
|
---|
| 15 | * @param value a simple name, starting with letter, followed by zero or
|
---|
| 16 | * more letters, digits or _.
|
---|
| 17 | */
|
---|
[1116] | 18 | public Bid(@NonNull String value) {
|
---|
[505] | 19 | this.value = value;
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | @JsonValue
|
---|
[1116] | 23 | public @NonNull String getValue() {
|
---|
[505] | 24 | return value;
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | @Override
|
---|
[1116] | 28 | public @NonNull String toString() {
|
---|
[505] | 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.