/** * Adapt a <code>KeyedObjectPool</code> instance to work where an <code>ObjectPool</code> is needed using the * specified <code>key</code> when delegating. * * @param <V> the type of object * @param keyedPool the {@link KeyedObjectPool} to delegate to. * @param key the key to use when delegating. * @return an {@link ObjectPool} that delegates to <code>keyedPool</code> with the specified key. * @throws IllegalArgumentException when <code>keyedPool</code> or <code>key</code> is <code>null</code>. * @see #adapt(KeyedObjectPool) * @since Pool 1.3 */ public static <V> ObjectPool<V> adapt(final KeyedObjectPool<Object, V> keyedPool, final Object key) throws IllegalArgumentException { return new ObjectPoolAdaptor<V>(keyedPool, key); }
/** * Adapt a <code>KeyedObjectPool</code> instance to work where an <code>ObjectPool</code> is needed using the * specified <code>key</code> when delegating. * * @param <V> the type of object * @param keyedPool the {@link KeyedObjectPool} to delegate to. * @param key the key to use when delegating. * @return an {@link ObjectPool} that delegates to <code>keyedPool</code> with the specified key. * @throws IllegalArgumentException when <code>keyedPool</code> or <code>key</code> is <code>null</code>. * @see #adapt(KeyedObjectPool) * @since Pool 1.3 */ public static <V> ObjectPool<V> adapt(final KeyedObjectPool<Object, V> keyedPool, final Object key) throws IllegalArgumentException { return new ObjectPoolAdaptor<V>(keyedPool, key); }
/** * Adapt a <code>KeyedObjectPool</code> instance to work where an <code>ObjectPool</code> is needed using the * specified <code>key</code> when delegating. * * @param keyedPool the {@link KeyedObjectPool} to delegate to. * @param key the key to use when delegating. * @return an {@link ObjectPool} that delegates to <code>keyedPool</code> with the specified key. * @throws IllegalArgumentException when <code>keyedPool</code> or <code>key</code> is <code>null</code>. * @see #adapt(KeyedObjectPool) * @since Pool 1.3 */ public static ObjectPool adapt(final KeyedObjectPool keyedPool, final Object key) throws IllegalArgumentException { return new ObjectPoolAdaptor(keyedPool, key); }
/** * Adapt a <code>KeyedObjectPool</code> instance to work where an <code>ObjectPool</code> is needed using the * specified <code>key</code> when delegating. * * @param keyedPool the {@link KeyedObjectPool} to delegate to. * @param key the key to use when delegating. * @return an {@link ObjectPool} that delegates to <code>keyedPool</code> with the specified key. * @throws IllegalArgumentException when <code>keyedPool</code> or <code>key</code> is <code>null</code>. * @see #adapt(KeyedObjectPool) * @since Pool 1.3 */ public static ObjectPool adapt(final KeyedObjectPool keyedPool, final Object key) throws IllegalArgumentException { return new ObjectPoolAdaptor(keyedPool, key); }
/** * Adapt a <code>KeyedObjectPool</code> instance to work where an <code>ObjectPool</code> is needed using the * specified <code>key</code> when delegating. * * @param <V> the type of object * @param keyedPool the {@link KeyedObjectPool} to delegate to. * @param key the key to use when delegating. * @return an {@link ObjectPool} that delegates to <code>keyedPool</code> with the specified key. * @throws IllegalArgumentException when <code>keyedPool</code> or <code>key</code> is <code>null</code>. * @see #adapt(KeyedObjectPool) * @since Pool 1.3 */ public static <V> ObjectPool<V> adapt(final KeyedObjectPool<Object, V> keyedPool, final Object key) throws IllegalArgumentException { return new ObjectPoolAdaptor<V>(keyedPool, key); }