Package org.jclouds.internal
Class BaseView
- java.lang.Object
-
- com.google.common.collect.ForwardingObject
-
- org.jclouds.internal.BaseView
-
- All Implemented Interfaces:
View
- Direct Known Subclasses:
BlobStoreContextImpl
,ComputeServiceContextImpl
,LoadBalancerServiceContextImpl
,RegionScopedBlobStoreContext
public abstract class BaseView extends com.google.common.collect.ForwardingObject implements View
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Context
delegate()
boolean
equals(Object o)
com.google.common.reflect.TypeToken<? extends Context>
getBackendType()
int
hashCode()
protected com.google.common.base.MoreObjects.ToStringHelper
string()
String
toString()
<C extends Context>
Cunwrap()
shortcut forunwrap(getWrappedType())
<C extends Context>
Cunwrap(com.google.common.reflect.TypeToken<C> type)
Return an object of the specified type to allow access to the backend context.<A extends Closeable>
AunwrapApi(Class<A> apiClass)
Unwraps the underlying api from this view.
-
-
-
Method Detail
-
unwrap
public <C extends Context> C unwrap(com.google.common.reflect.TypeToken<C> type)
Description copied from interface:View
Return an object of the specified type to allow access to the backend context. If the backend context is not assignable from the supplied type, anIllegalArgumentException
is thrown. ex.ApiContext
backendApi = computeContext.unwrap(new TypeToken >(){}); - Specified by:
unwrap
in interfaceView
- Parameters:
type
- the type of the context to be returned. The backend context must be assignable from this type.- Returns:
- an instance of the specified type
- See Also:
View.getBackendType()
-
getBackendType
public com.google.common.reflect.TypeToken<? extends Context> getBackendType()
- Specified by:
getBackendType
in interfaceView
- Returns:
- type of the context powering the current one.
-
unwrap
public <C extends Context> C unwrap() throws ClassCastException
Description copied from interface:View
shortcut forunwrap(getWrappedType())
- Specified by:
unwrap
in interfaceView
- Throws:
ClassCastException
- if the user suppliedC
param is not assignableFromView.getBackendType()
-
unwrapApi
public <A extends Closeable> A unwrapApi(Class<A> apiClass)
Description copied from interface:View
Unwraps the underlying api from this view.
-
delegate
protected Context delegate()
- Specified by:
delegate
in classcom.google.common.collect.ForwardingObject
-
toString
public String toString()
- Overrides:
toString
in classcom.google.common.collect.ForwardingObject
-
string
protected com.google.common.base.MoreObjects.ToStringHelper string()
-
-