@Test(expectedExceptions = {JSONConverterException.class}, dataProvider = "getInvalidInts") public void testInValidRequiredInt(String storeKey, String readKey, Object o) throws JSONConverterException { JSONObject obj = new JSONObject(); obj.put(storeKey, o); JSONs.requiredInt(obj, readKey); }
public static int requiredInt(JSONObject o, String id) throws JSONConverterException { checkKeys(o, id); try { return (Integer) o.get(id); } catch (ClassCastException e) { throw new JSONConverterException("Unable to read a int from string '" + id + "'", e); } }
JSONs { public static int requiredInt(JSONObject o, String id) throws JSONConverterException { checkKeys(o, id); try { return (Integer) o.get(id); } catch (ClassCastException e) { throw new JSONConverterException("Unable to read a int from string '" + id + "'", e); } } }
JSONs { public static int requiredInt(JSONObject o, String id) throws JSONConverterException { checkKeys(o, id); try { return (Integer) o.get(id); } catch (ClassCastException e) { throw new JSONConverterException("Unable to read a int from string '" + id + "'", e); } } private  JSONs(); }
JSONs { public static int requiredInt(JSONObject o, String id) throws JSONConverterException { checkKeys(o, id); try { return (Integer) o.get(id); } catch (ClassCastException e) { throw new JSONConverterException("Unable to read a int from string '" + id + "'", e); } } private  JSONs(); static void resetCaches(int size); static int requiredInt(JSONObject o, String id); static int optInt(JSONObject o, String id, int def); static void checkKeys(JSONObject o, String... keys); static String requiredString(JSONObject o, String id); static double requiredDouble(JSONObject o, String id); static boolean requiredBoolean(JSONObject o, String id); static List<VM> vmsFromJSON(Model mo, JSONArray a); static List<Node> nodesFromJSON(Model mo, JSONArray a); static JSONArray vmsToJSON(Collection<VM> s); static JSONArray nodesToJSON(Collection<Node> s); static List<VM> requiredVMs(Model mo, JSONObject o, String id); static List<Node> requiredNodes(Model mo, JSONObject o, String id); static Set<Collection<VM>> requiredVMPart(Model mo, JSONObject o, String id); static Set<Collection<Node>> requiredNodePart(Model mo, JSONObject o, String id); static VM requiredVM(Model mo, JSONObject o, String id); static Node requiredNode(Model mo, JSONObject o, String id); static VM getVM(Model mo, int vmID); static Node getNode(Model mo, int nodeID); static Integer elementToJSON(Element e); }
JSONs { public static int requiredInt(JSONObject o, String id) throws JSONConverterException { checkKeys(o, id); try { return (Integer) o.get(id); } catch (ClassCastException e) { throw new JSONConverterException("Unable to read a int from string '" + id + "'", e); } } private  JSONs(); static void resetCaches(int size); static int requiredInt(JSONObject o, String id); static int optInt(JSONObject o, String id, int def); static void checkKeys(JSONObject o, String... keys); static String requiredString(JSONObject o, String id); static double requiredDouble(JSONObject o, String id); static boolean requiredBoolean(JSONObject o, String id); static List<VM> vmsFromJSON(Model mo, JSONArray a); static List<Node> nodesFromJSON(Model mo, JSONArray a); static JSONArray vmsToJSON(Collection<VM> s); static JSONArray nodesToJSON(Collection<Node> s); static List<VM> requiredVMs(Model mo, JSONObject o, String id); static List<Node> requiredNodes(Model mo, JSONObject o, String id); static Set<Collection<VM>> requiredVMPart(Model mo, JSONObject o, String id); static Set<Collection<Node>> requiredNodePart(Model mo, JSONObject o, String id); static VM requiredVM(Model mo, JSONObject o, String id); static Node requiredNode(Model mo, JSONObject o, String id); static VM getVM(Model mo, int vmID); static Node getNode(Model mo, int nodeID); static Integer elementToJSON(Element e);  }