/** * Converts the given JSON value to either a vtype, a Java time or a * ListNumber. * * @param msgValue the JSON value * @return the converted type */ public static Object readValueFromJson(JsonValue msgValue) { if (msgValue instanceof JsonObject) { return VTypeToJson.toVType((JsonObject) msgValue); } else if (msgValue instanceof JsonNumber) { return ((JsonNumber) msgValue).doubleValue(); } else if (msgValue instanceof JsonString){ return ((JsonString) msgValue).getString(); } else if (msgValue instanceof JsonArray){ JsonArray array = (JsonArray) msgValue; if (isNumericArray(array)) { return toListDouble(array); } else if (isStringArray(array)) { return toListString(array); } else { return null; } } else { return null; } }