Package org.opensaml.messaging.context.navigate

# 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 context
  `ChildContext` - 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>
A `ContextDataLookupFunction` that gets the child context of a given parent context.

## Field Summary

Fields
Modifier and Type
Field
Description
`private boolean`
`autocreate`
Whether the child context should be created if it doesn't exist.
`private final Class<ChildContext>`
`childType`
Child context type to look up.

## Constructor Summary

Constructors
Constructor
Description
`ChildContextLookup(Class<ChildContext> type)`
Constructor.
`ChildContextLookup(Class<ChildContext> type, boolean createContext)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`ChildContext`
`apply(ParentContext input)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.function.Function

`andThen, compose`

## Field Details

### 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 Details

### ChildContextLookup

public ChildContextLookup(@Nonnull @ParameterName(name="type") Class<ChildContext> type)
Constructor.

Equivalent to calling the two-parameter constructor with false.

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 up
  `createContext` - whether to create the child context if it does not exist

## Method Details

### apply

@Nullable public ChildContext apply(@Nullable ParentContext input)

Specified by:
  `apply` in interface `Function<ParentContext extends BaseContext,ChildContext extends BaseContext>`