jsonp-api
jsonp-api copied to clipboard
Ease testing for JsonValue type
Currently yo determine JsonValue
type the code should look something like:
JsonValue value = ....;
if (ValueType.OBJECT == value.getValueType()) {
}
if (ValueType.ARRAY == value.getValueType()) {
}
What about adding methods to JsonValue
:
public interface JsonValue {
boolean isObject();
boolean isArray();
boolean isNumber();
boolean isString();
}
- Issue Imported From: https://github.com/javaee/jsonp/issues/64
- Original Issue Raised By:@avalchev
- Original Issue Assigned To: @m0mus
@m0mus Commented This is a spec enhancement. We will review it when we will start gathering new major version features.