@Singleton public abstract class BaseView extends com.google.common.collect.ForwardingObject implements View
| Modifier | Constructor and Description |
|---|---|
protected |
BaseView(Context backend,
com.google.common.reflect.TypeToken<? extends Context> backendType) |
| Modifier and Type | Method and Description |
|---|---|
protected Context |
delegate() |
boolean |
equals(Object o) |
com.google.common.reflect.TypeToken<? extends Context> |
getBackendType() |
int |
hashCode() |
protected com.google.common.base.Objects.ToStringHelper |
string() |
String |
toString() |
<C extends Context> |
unwrap()
shortcut for
unwrap(getWrappedType()) |
<C extends Context> |
unwrap(Class<C> clazz)
shortcut for
unwrap(TypeToken.of(clazz)) |
<C extends Context> |
unwrap(com.google.common.reflect.TypeToken<C> type)
Return an object of the specified type to allow access to the backend
context.
|
public <C extends Context> C unwrap(com.google.common.reflect.TypeToken<C> type)
ViewIllegalArgumentException is thrown.
ex.
RestContextbackendApi = computeContext.unwrap(NovaApiMetadata.CONTEXT_TOKEN);
unwrap in interface Viewtype - the type of the context to be returned. The backend context must
be assignable from this type.View.getBackendType()public <C extends Context> C unwrap(Class<C> clazz)
Viewunwrap(TypeToken.of(clazz))unwrap in interface ViewView.unwrap(TypeToken)public com.google.common.reflect.TypeToken<? extends Context> getBackendType()
getBackendType in interface Viewpublic <C extends Context> C unwrap() throws ClassCastException
Viewunwrap(getWrappedType())unwrap in interface ViewClassCastException - if the user supplied C param is not assignableFrom
View.getBackendType()protected Context delegate()
delegate in class com.google.common.collect.ForwardingObjectpublic String toString()
toString in class com.google.common.collect.ForwardingObjectprotected com.google.common.base.Objects.ToStringHelper string()
Copyright © 2009-2013 jclouds. All Rights Reserved.