public final class Context extends Object
| Modifier and Type | Method and Description |
|---|---|
<T> T |
get(Class<T> type)
Gets the single element of the given type in the import context, returning
null if none is present. |
<T> Collection<T> |
getAll(Class<T> type)
Gets all the element of the given type in the import context
|
Context |
put(Object obj)
Add the given object to the context
|
Context |
putAll(Collection<?> objs)
Add all the given objects to the context
|
public Context(Object... objects)
public <T> T get(Class<T> type)
null if none is present.T - the type parameter of the type to look fortype - the type of the element to look fornull otherwiseIllegalStateException - if more than one element of the given type are present in the context. If you need
to get multiple elements of type T use the getAll(Class) method.getAll(Class)public <T> Collection<T> getAll(Class<T> type)
T - the type parameter of the type to look fortype - the type of the elements to look forT, note that there might be none.get(Class)public Context put(Object obj)
obj - the new object in the contextthispublic Context putAll(Collection<?> objs)
objs - the collection of objects to add to the contextthisCopyright © 2018 Atlassian. All rights reserved.