Interface ContextInheritance
-
public interface ContextInheritance
Holder for information about inheritance between contexts. Immutable.- Since:
- 2.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<ContextValue<?>,List<ContextValue<?>>>allParents()Get all parent data as a map from context to list of parent contexts.List<ContextValue<?>>parents(ContextValue<?> context)Get the parents of a specific context.ContextInheritanceparents(ContextValue<?> context, @Nullable List<ContextValue<?>> parents)Set the parents for a specific context.
-
-
-
Method Detail
-
parents
List<ContextValue<?>> parents(ContextValue<?> context)
Get the parents of a specific context.When this context is present in a subject's active contexts, its parents are appended to the subject's active contexts for the purpose of data queries.
- Parameters:
context- The child context- Returns:
- Any parent contexts, or an empty list
- Since:
- 2.0.0
-
parents
ContextInheritance parents(ContextValue<?> context, @Nullable List<ContextValue<?>> parents)
Set the parents for a specific context.- Parameters:
context- The context to set parents inparents- The parents to set, ornullto clear parents for the context.- Returns:
- A new context inheritance object with the updated parents
- Since:
- 2.0.0
-
allParents
Map<ContextValue<?>,List<ContextValue<?>>> allParents()
Get all parent data as a map from context to list of parent contexts.The returned map is immutable.
- Returns:
- parents
- Since:
- 2.0.0
-
-