Class ChildContextLookup<ParentContext extends BaseContext,ChildContext extends BaseContext>
- java.lang.Object
-
- org.opensaml.messaging.context.navigate.ChildContextLookup<ParentContext,ChildContext>
-
- Type Parameters:
ParentContext- type of the parent contextChildContext- type of the child context
- All Implemented Interfaces:
Function<ParentContext,ChildContext>,ContextDataLookupFunction<ParentContext,ChildContext>
public class ChildContextLookup<ParentContext extends BaseContext,ChildContext extends BaseContext> extends Object implements ContextDataLookupFunction<ParentContext,ChildContext>
AContextDataLookupFunctionthat gets the child context of a given parent context.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanautocreateWhether the child context should be created if it doesn't exist.private Class<ChildContext>childTypeChild context type to look up.
-
Constructor Summary
Constructors Constructor Description ChildContextLookup(Class<ChildContext> type)Constructor.ChildContextLookup(Class<ChildContext> type, boolean createContext)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChildContextapply(ParentContext input)
-
-
-
Field Detail
-
childType
@Nonnull private final Class<ChildContext extends BaseContext> childType
Child context type to look up.
-
autocreate
private boolean autocreate
Whether the child context should be created if it doesn't exist. This requires that the child context has a no-arg constructor.
-
-
Constructor Detail
-
ChildContextLookup
public ChildContextLookup(@Nonnull @ParameterName(name="type") Class<ChildContext> type)Constructor. Setsautocreatetofalse.- Parameters:
type- child context type to look up
-
ChildContextLookup
public ChildContextLookup(@Nonnull @ParameterName(name="type") Class<ChildContext> type, @ParameterName(name="createContext") boolean createContext)Constructor.- Parameters:
type- child context type to look upcreateContext- whether to create the child context if it does not exist
-
-
Method Detail
-
apply
@Nullable public ChildContext apply(@Nullable ParentContext input)
- Specified by:
applyin interfaceFunction<ParentContext extends BaseContext,ChildContext extends BaseContext>
-
-