@Test public void testIsValidObject_Node() { assertFalse(SchemaUtils.isValidObject("nodeName", Schema.NODE)); assertTrue(SchemaUtils.isValidObject(new Node("node"), Schema.NODE)); }
public static boolean isValidObject(Object object, Schema schema) { JsonNode jsonNode = BatfishObjectMapper.mapper().valueToTree(object); try { convertType(jsonNode, schema); } catch (ClassCastException e) { return false; } return true; }
SchemaUtils { public static boolean isValidObject(Object object, Schema schema) { JsonNode jsonNode = BatfishObjectMapper.mapper().valueToTree(object); try { convertType(jsonNode, schema); } catch (ClassCastException e) { return false; } return true; } }
SchemaUtils { public static boolean isValidObject(Object object, Schema schema) { JsonNode jsonNode = BatfishObjectMapper.mapper().valueToTree(object); try { convertType(jsonNode, schema); } catch (ClassCastException e) { return false; } return true; } private  SchemaUtils(); }
SchemaUtils { public static boolean isValidObject(Object object, Schema schema) { JsonNode jsonNode = BatfishObjectMapper.mapper().valueToTree(object); try { convertType(jsonNode, schema); } catch (ClassCastException e) { return false; } return true; } private  SchemaUtils(); @Nullable static Object convertType(JsonNode jsonNode, Schema schema); static boolean isValidObject(Object object, Schema schema); }
SchemaUtils { public static boolean isValidObject(Object object, Schema schema) { JsonNode jsonNode = BatfishObjectMapper.mapper().valueToTree(object); try { convertType(jsonNode, schema); } catch (ClassCastException e) { return false; } return true; } private  SchemaUtils(); @Nullable static Object convertType(JsonNode jsonNode, Schema schema); static boolean isValidObject(Object object, Schema schema);  }