/** * Gets a value indicating whether a cached value exists for the given key. */ public boolean contains(final K key) { return get(key) != null; }
/** * Gets a value indicating whether a cached value exists for the given key. */ public boolean contains(final K key) { return get(key) != null; }
/** * Gets a value indicating whether a cached value exists for the given key. */ public boolean contains(final K key) { return get(key) != null; }
/** * Gets a value indicating whether the cached value matches the given value * for a specified key. */ public boolean contains(final K key, final V value) { final V cachedValue = get(key); return cachedValue != null && cachedValue.equals(value); }
/** * Gets a value indicating whether the cached value matches the given value * for a specified key. */ public boolean contains(final K key, final V value) { final V cachedValue = get(key); return cachedValue != null && cachedValue.equals(value); }
/** * Gets a value indicating whether the cached value matches the given value * for a specified key. */ public boolean contains(final K key, final V value) { final V cachedValue = get(key); return cachedValue != null && cachedValue.equals(value); }
@Override public V get(final K key) { V cachedValue = _cache.get(key); if (cachedValue != null) { return cachedValue; } if (_parent != null) { cachedValue = _parent.get(key); if (cachedValue != null) { _cache.put(key, cachedValue); } } return cachedValue; } }
@Override public V get(final K key) { V cachedValue = _cache.get(key); if (cachedValue != null) { return cachedValue; } if (_parent != null) { cachedValue = _parent.get(key); if (cachedValue != null) { _cache.put(key, cachedValue); } } return cachedValue; } }
@Override public V get(final K key) { V cachedValue = _cache.get(key); if (cachedValue != null) { return cachedValue; } if (_parent != null) { cachedValue = _parent.get(key); if (cachedValue != null) { _cache.put(key, cachedValue); } } return cachedValue; } }
public static <T> Class<T[]> makeArrayType(final Class<T> elementType) { final Class<?> arrayType = ARRAY_TYPE_CACHE.get(elementType); if (arrayType != null) { return (Class<T[]>)arrayType; } return (Class<T[]>)ARRAY_TYPE_CACHE.cache( elementType, Array.newInstance(elementType, 0).getClass() ); }
public static <T> Class<T[]> makeArrayType(final Class<T> elementType) { final Class<?> arrayType = ARRAY_TYPE_CACHE.get(elementType); if (arrayType != null) { return (Class<T[]>)arrayType; } return (Class<T[]>)ARRAY_TYPE_CACHE.cache( elementType, Array.newInstance(elementType, 0).getClass() ); }
public static <T> Class<T[]> makeArrayType(final Class<T> elementType) { final Class<?> arrayType = ARRAY_TYPE_CACHE.get(elementType); if (arrayType != null) { return (Class<T[]>)arrayType; } return (Class<T[]>)ARRAY_TYPE_CACHE.cache( elementType, Array.newInstance(elementType, 0).getClass() ); }
public static Object fromElementOrPrimitiveType(final Class<?> elementType) { VerifyArgument.notNull(elementType, "elementType"); final Object cachedArray = THREAD_LOCAL_CACHE.get(elementType); if (cachedArray != null) { return cachedArray; } return THREAD_LOCAL_CACHE.cache(elementType, Array.newInstance(elementType, 0)); }
@SuppressWarnings("unchecked") public static <T> T[] fromElementType(final Class<T> elementType) { VerifyArgument.notNull(elementType, "elementType"); final T[] cachedArray = (T[])THREAD_LOCAL_CACHE.get(elementType); if (cachedArray != null) { return cachedArray; } return (T[])THREAD_LOCAL_CACHE.cache(elementType, Array.newInstance(elementType, 0)); }
public static Object fromElementOrPrimitiveType(final Class<?> elementType) { VerifyArgument.notNull(elementType, "elementType"); final Object cachedArray = THREAD_LOCAL_CACHE.get(elementType); if (cachedArray != null) { return cachedArray; } return THREAD_LOCAL_CACHE.cache(elementType, Array.newInstance(elementType, 0)); }
@SuppressWarnings("unchecked") public static <T> T[] fromElementType(final Class<T> elementType) { VerifyArgument.notNull(elementType, "elementType"); final T[] cachedArray = (T[])THREAD_LOCAL_CACHE.get(elementType); if (cachedArray != null) { return cachedArray; } return (T[])THREAD_LOCAL_CACHE.cache(elementType, Array.newInstance(elementType, 0)); }
public static Object fromElementOrPrimitiveType(final Class<?> elementType) { VerifyArgument.notNull(elementType, "elementType"); final Object cachedArray = THREAD_LOCAL_CACHE.get(elementType); if (cachedArray != null) { return cachedArray; } return THREAD_LOCAL_CACHE.cache(elementType, Array.newInstance(elementType, 0)); }
@SuppressWarnings("unchecked") public static <T> T[] fromElementType(final Class<T> elementType) { VerifyArgument.notNull(elementType, "elementType"); final T[] cachedArray = (T[])THREAD_LOCAL_CACHE.get(elementType); if (cachedArray != null) { return cachedArray; } return (T[])THREAD_LOCAL_CACHE.cache(elementType, Array.newInstance(elementType, 0)); }