/** * Returns the runtime value type associated with the given key. Caches * results in a private Map. * * @param key The annotation key (non-null) * @return The type of the value of that key (non-null) */ @SuppressWarnings("unchecked") public static Class<?> getValueType(Class<? extends CoreAnnotation<?>> key) { Class type = valueCache.get(key); if (type == null) { try { type = key.newInstance().getType(); } catch (Exception e) { throw new RuntimeException("Unexpected failure to instantiate - is your key class fancy?", e); } valueCache.put((Class)key, type); } return type; }
/** * Returns the runtime value type associated with the given key. Caches * results. */ @SuppressWarnings("unchecked") public static Class<?> getValueType(Class<? extends CoreAnnotation> key) { Class type = valueCache.get(key); if (type == null) { try { type = key.newInstance().getType(); } catch (Exception e) { throw new RuntimeException("Unexpected failure to instantiate - is your key class fancy?", e); } valueCache.put((Class)key, type); } return type; }
/** * Returns the runtime value type associated with the given key. Caches * results. */ @SuppressWarnings("unchecked") public static Class<?> getValueType(Class<? extends CoreAnnotation> key) { Class type = valueCache.get(key); if (type == null) { try { type = key.newInstance().getType(); } catch (Exception e) { throw new RuntimeException("Unexpected failure to instantiate - is your key class fancy?", e); } valueCache.put((Class)key, type); } return type; }
/** * Returns the runtime value type associated with the given key. Caches * results in a private Map. * * @param key The annotation key (non-null) * @return The type of the value of that key (non-null) */ @SuppressWarnings("unchecked") public static Class<?> getValueType(Class<? extends CoreAnnotation<?>> key) { Class type = valueCache.get(key); if (type == null) { try { type = key.newInstance().getType(); } catch (Exception e) { throw new RuntimeException("Unexpected failure to instantiate - is your key class fancy?", e); } valueCache.put((Class)key, type); } return type; }
/** * Returns the runtime value type associated with the given key. Caches * results in a private Map. * * @param key The annotation key (non-null) * @return The type of the value of that key (non-null) */ @SuppressWarnings("unchecked") public static Class<?> getValueType(Class<? extends CoreAnnotation<?>> key) { Class type = valueCache.get(key); if (type == null) { try { type = key.newInstance().getType(); } catch (Exception e) { throw new RuntimeException("Unexpected failure to instantiate - is your key class fancy?", e); } valueCache.put((Class)key, type); } return type; }