private static <T> Type getTypeOrDie(Class<T> clazz) { Type toReturn = findType(clazz); if (toReturn == null) { throw new UnsupportedOperationException(clazz.getName()); } return toReturn; } }
/** * Returns true if ValueCodex can operate on values of the given type. * * @param clazz a Class object * @return {@code true} if the given object type can be decoded */ public static boolean canDecode(Class<?> clazz) { if (findType(clazz) != null) { return true; } // Use other platform-specific tests return ValueCodexHelper.canDecode(clazz); }
public static Splittable encode(Object obj) { if (obj == null) { return Splittable.NULL; } Type t = findType(obj.getClass()); // Try upcasting if (t == null) { for (Type maybe : Type.values()) { if (maybe.canUpcast(obj)) { t = maybe; break; } } } if (t == null) { throw new UnsupportedOperationException(obj.getClass().getName()); } return t.encode(obj); }
private static <T> Type getTypeOrDie(Class<T> clazz) { Type toReturn = findType(clazz); if (toReturn == null) { throw new UnsupportedOperationException(clazz.getName()); } return toReturn; } }
private static <T> Type getTypeOrDie(Class<T> clazz) { Type toReturn = findType(clazz); if (toReturn == null) { throw new UnsupportedOperationException(clazz.getName()); } return toReturn; } }
private static <T> Type getTypeOrDie(Class<T> clazz) { Type toReturn = findType(clazz); if (toReturn == null) { throw new UnsupportedOperationException(clazz.getName()); } return toReturn; } }
/** * Returns true if ValueCodex can operate on values of the given type. * * @param clazz a Class object * @return {@code true} if the given object type can be decoded */ public static boolean canDecode(Class<?> clazz) { if (findType(clazz) != null) { return true; } // Use other platform-specific tests return ValueCodexHelper.canDecode(clazz); }
/** * Returns true if ValueCodex can operate on values of the given type. * * @param clazz a Class object * @return {@code true} if the given object type can be decoded */ public static boolean canDecode(Class<?> clazz) { if (findType(clazz) != null) { return true; } // Use other platform-specific tests return ValueCodexHelper.canDecode(clazz); }
/** * Returns true if ValueCodex can operate on values of the given type. * * @param clazz a Class object * @return {@code true} if the given object type can be decoded */ public static boolean canDecode(Class<?> clazz) { if (findType(clazz) != null) { return true; } // Use other platform-specific tests return ValueCodexHelper.canDecode(clazz); }
public static Splittable encode(Object obj) { if (obj == null) { return Splittable.NULL; } Type t = findType(obj.getClass()); // Try upcasting if (t == null) { for (Type maybe : Type.values()) { if (maybe.canUpcast(obj)) { t = maybe; break; } } } if (t == null) { throw new UnsupportedOperationException(obj.getClass().getName()); } return t.encode(obj); }
public static Splittable encode(Object obj) { if (obj == null) { return Splittable.NULL; } Type t = findType(obj.getClass()); // Try upcasting if (t == null) { for (Type maybe : Type.values()) { if (maybe.canUpcast(obj)) { t = maybe; break; } } } if (t == null) { throw new UnsupportedOperationException(obj.getClass().getName()); } return t.encode(obj); }
public static Splittable encode(Object obj) { if (obj == null) { return Splittable.NULL; } Type t = findType(obj.getClass()); // Try upcasting if (t == null) { for (Type maybe : Type.values()) { if (maybe.canUpcast(obj)) { t = maybe; break; } } } if (t == null) { throw new UnsupportedOperationException(obj.getClass().getName()); } return t.encode(obj); }