@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)
View
IllegalArgumentException
is thrown.
ex.
RestContextbackendApi = computeContext.unwrap(NovaApiMetadata.CONTEXT_TOKEN);
unwrap
in interface View
type
- 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)
View
unwrap(TypeToken.of(clazz))
unwrap
in interface View
View.unwrap(TypeToken)
public com.google.common.reflect.TypeToken<? extends Context> getBackendType()
getBackendType
in interface View
public <C extends Context> C unwrap() throws ClassCastException
View
unwrap(getWrappedType())
unwrap
in interface View
ClassCastException
- if the user supplied C
param is not assignableFrom
View.getBackendType()
protected Context delegate()
delegate
in class com.google.common.collect.ForwardingObject
public String toString()
toString
in class com.google.common.collect.ForwardingObject
protected com.google.common.base.Objects.ToStringHelper string()
Copyright © 2009-2013 jclouds. All Rights Reserved.