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(com.google.common.reflect.TypeToken<C> type)
Return an object of the specified type to allow access to the backend
context.
|
<A extends Closeable> |
unwrapApi(Class<A> apiClass)
Unwraps the underlying api from this view.
|
public <C extends Context> C unwrap(com.google.common.reflect.TypeToken<C> type)
View
IllegalArgumentException
is thrown.
ex.
ApiContextbackendApi = computeContext.unwrap(new TypeToken >(){});
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 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()
public <A extends Closeable> A unwrapApi(Class<A> apiClass)
View
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-2016 The Apache Software Foundation. All Rights Reserved.