ParentContext - type of the parent contextChildContext - type of the child contextpublic class ChildContextLookup<ParentContext extends BaseContext,ChildContext extends BaseContext> extends java.lang.Object implements ContextDataLookupFunction<ParentContext,ChildContext>
ContextDataLookupFunction that gets the child context of a given parent context.| Modifier and Type | Field and Description |
|---|---|
private boolean |
autocreate
Whether the child context should be created if it doesn't exist.
|
private java.lang.Class<ChildContext> |
childType
Child context type to look up.
|
| Constructor and Description |
|---|
ChildContextLookup(java.lang.Class<ChildContext> type)
Constructor.
|
ChildContextLookup(java.lang.Class<ChildContext> type,
boolean createContext)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
ChildContext |
apply(ParentContext input) |
private final java.lang.Class<ChildContext extends BaseContext> childType
private boolean autocreate
public ChildContextLookup(@Nonnull
java.lang.Class<ChildContext> type)
autocreate to false.type - child context type to look uppublic ChildContextLookup(@Nonnull
java.lang.Class<ChildContext> type,
boolean createContext)
type - child context type to look upcreateContext - whether to create the child context if it does not exist@Nullable public ChildContext apply(@Nullable ParentContext input)
apply in interface com.google.common.base.Function<ParentContext extends BaseContext,ChildContext extends BaseContext>