Constructor and Description |
---|
GuiceContext(com.google.inject.Injector injector)
Constructs a context backed by the given Guice injector.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(java.lang.Class<?> clazz)
Returns whether this context has a value associated with the given class.
|
boolean |
containsKey(Property<?> property)
Returns whether this context has a value associated with the given
property.
|
<T> T |
get(java.lang.Class<T> clazz)
Returns the context value associated with the given class.
|
<T> T |
get(Property<T> property)
Returns the context value associated with the given property.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOrDefault
@Inject public GuiceContext(com.google.inject.Injector injector)
injector
- a Guice injector (not null
)public <T> T get(Property<T> property)
IContext
public <T> T get(java.lang.Class<T> clazz)
IContext
public boolean containsKey(Property<?> property)
IContext
containsKey
in interface IContext
property
- the property being queried (not null
)true
if this context has a value
for the given property, and false
otherwisepublic boolean containsKey(java.lang.Class<?> clazz)
IContext
containsKey
in interface IContext
clazz
- the class being queried (not null
)true
if this context has a value
for the given class, and false
otherwiseCopyright (c) 2014, 2020 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0