private static void makeDefaultImmuatableSet() { immutableTypes = getImmutableDefaults().keySet(); }
private static void makeDefaultImmuatableSet() { immutableTypes = getImmutableDefaults().keySet(); }
/** * Get the default value for for a type if one is available OR null if there is no default (since null sorta is the default) * @param <T> * @param type any class type including primitives * @return the default value OR null if there is no default */ @SuppressWarnings("unchecked") public static <T> T getDefaultValue(Class<T> type) { T val = null; if (getPrimitiveDefaults().containsKey(type)) { val = (T) getPrimitiveDefaults().get(type); } else if (getImmutableDefaults().containsKey(type)) { val = (T) getImmutableDefaults().get(type); } return val; }
/** * Get the default value for for a type if one is available OR null if there is no default (since null sorta is the default) * @param <T> * @param type any class type including primitives * @return the default value OR null if there is no default */ @SuppressWarnings("unchecked") public static <T> T getDefaultValue(Class<T> type) { T val = null; if (getPrimitiveDefaults().containsKey(type)) { val = (T) getPrimitiveDefaults().get(type); } else if (getImmutableDefaults().containsKey(type)) { val = (T) getImmutableDefaults().get(type); } return val; }