mirror of https://github.com/apache/jclouds.git
missing unwrap class arg
This commit is contained in:
parent
9267ac29ba
commit
1d85435fe8
|
@ -51,8 +51,14 @@ public interface Wrapper {
|
|||
* if the wrapped context is not assignable from the specified class.
|
||||
* @see #getWrappedType()
|
||||
*/
|
||||
<C extends Closeable> C unwrap(TypeToken<C> type);
|
||||
|
||||
<C extends Closeable> C unwrap(TypeToken<C> type) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* shortcut for {@code unwrap(TypeToken.of(clazz))}
|
||||
* @see #unwrap(TypeToken)
|
||||
*/
|
||||
<C extends Closeable> C unwrap(Class<C> clazz) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* shortcut for {@code unwrap(getWrappedType())}
|
||||
*
|
||||
|
|
|
@ -53,7 +53,12 @@ public abstract class BaseWrapper implements Wrapper {
|
|||
checkArgument(checkNotNull(type, "type").isAssignableFrom(wrappedType), "wrapped type: %s not assignable from %s", wrappedType, type);
|
||||
return (C) wrapped;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <C extends Closeable> C unwrap(Class<C> clazz) {
|
||||
return unwrap (TypeToken.of(checkNotNull(clazz, "clazz")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeToken<? extends Closeable> getWrappedType() {
|
||||
return wrappedType;
|
||||
|
|
Loading…
Reference in New Issue