@UseDataProvider("knownTypesByClassData") @Test public void resolvesKnownTypesByClass(Class<?> aClass, Types expectedType) { assertEquals(expectedType, JsonUtils.getType(aClass)); }
public static Types getType(Object o) { if (o == null) { return Types.NULL; } if (KNOWN_TYPES.get(o.getClass().getName()) != null) { return KNOWN_TYPES.get(o.getClass().getName()); } if (o instanceof Enum) { return Types.ENUM; } if (o instanceof Object[]) { return Types.ARRAY_OBJECT; } if (o instanceof Collection) { return Types.COLLECTION; } if (o instanceof Map) { return Types.MAP; } return null; }
JsonUtils { public static Types getType(Object o) { if (o == null) { return Types.NULL; } if (KNOWN_TYPES.get(o.getClass().getName()) != null) { return KNOWN_TYPES.get(o.getClass().getName()); } if (o instanceof Enum) { return Types.ENUM; } if (o instanceof Object[]) { return Types.ARRAY_OBJECT; } if (o instanceof Collection) { return Types.COLLECTION; } if (o instanceof Map) { return Types.MAP; } return null; } }
JsonUtils { public static Types getType(Object o) { if (o == null) { return Types.NULL; } if (KNOWN_TYPES.get(o.getClass().getName()) != null) { return KNOWN_TYPES.get(o.getClass().getName()); } if (o instanceof Enum) { return Types.ENUM; } if (o instanceof Object[]) { return Types.ARRAY_OBJECT; } if (o instanceof Collection) { return Types.COLLECTION; } if (o instanceof Map) { return Types.MAP; } return null; } private  JsonUtils(); }
JsonUtils { public static Types getType(Object o) { if (o == null) { return Types.NULL; } if (KNOWN_TYPES.get(o.getClass().getName()) != null) { return KNOWN_TYPES.get(o.getClass().getName()); } if (o instanceof Enum) { return Types.ENUM; } if (o instanceof Object[]) { return Types.ARRAY_OBJECT; } if (o instanceof Collection) { return Types.COLLECTION; } if (o instanceof Map) { return Types.MAP; } return null; } private  JsonUtils(); static String getJsonString(String string); static boolean isKnownType(Class<?> clazz); static Types getType(Object o); static Types getType(Class<?> clazz); static Set<String> getTransientFields(Class<?> aClass); @SuppressWarnings({"unchecked"}) static T createProxy(Class<T> anInterface); }
JsonUtils { public static Types getType(Object o) { if (o == null) { return Types.NULL; } if (KNOWN_TYPES.get(o.getClass().getName()) != null) { return KNOWN_TYPES.get(o.getClass().getName()); } if (o instanceof Enum) { return Types.ENUM; } if (o instanceof Object[]) { return Types.ARRAY_OBJECT; } if (o instanceof Collection) { return Types.COLLECTION; } if (o instanceof Map) { return Types.MAP; } return null; } private  JsonUtils(); static String getJsonString(String string); static boolean isKnownType(Class<?> clazz); static Types getType(Object o); static Types getType(Class<?> clazz); static Set<String> getTransientFields(Class<?> aClass); @SuppressWarnings({"unchecked"}) static T createProxy(Class<T> anInterface);  }