mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-08 03:24:27 +08:00
* Cleans up some warnings * Adds new test for bug https://github.com/stleary/JSON-java/issues/332 * Adds some resource handling for string writers using pre-java1.7 support. I know StringWriters don't need a close method called, but the tests should still handle their resources properly.
29 lines
596 B
Java
29 lines
596 B
Java
package org.json.junit;
|
|
|
|
/**
|
|
* An enum that contains getters and some internal fields
|
|
*/
|
|
@SuppressWarnings("boxing")
|
|
public enum MyEnumField {
|
|
VAL1(1, "val 1"),
|
|
VAL2(2, "val 2"),
|
|
VAL3(3, "val 3");
|
|
|
|
private String value;
|
|
private Integer intVal;
|
|
private MyEnumField(Integer intVal, String value) {
|
|
this.value = value;
|
|
this.intVal = intVal;
|
|
}
|
|
public String getValue() {
|
|
return this.value;
|
|
}
|
|
public Integer getIntVal() {
|
|
return this.intVal;
|
|
}
|
|
@Override
|
|
public String toString(){
|
|
return this.value;
|
|
}
|
|
}
|