Package org.eclipse.handly.context
Class GuiceContext
java.lang.Object
org.eclipse.handly.context.GuiceContext
- All Implemented Interfaces:
IContext
-
Constructor Summary
ConstructorsConstructorDescriptionGuiceContext(com.google.inject.Injector injector) Constructs a context backed by the given Guice injector. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Class<?> clazz) Returns whether this context has a value associated with the given class.booleancontainsKey(Property<?> property) Returns whether this context has a value associated with the given property.<T> TReturns the context value associated with the given class.<T> TReturns the context value associated with the given property.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.handly.context.IContext
getOrDefault
-
Constructor Details
-
GuiceContext
@Inject public GuiceContext(com.google.inject.Injector injector) Constructs a context backed by the given Guice injector.- Parameters:
injector- a Guice injector (notnull)
-
-
Method Details
-
get
Description copied from interface:IContextReturns the context value associated with the given property. -
get
Description copied from interface:IContextReturns the context value associated with the given class. -
containsKey
Description copied from interface:IContextReturns whether this context has a value associated with the given property.- Specified by:
containsKeyin interfaceIContext- Parameters:
property- the property being queried (notnull)- Returns:
trueif this context has a value for the given property, andfalseotherwise
-
containsKey
Description copied from interface:IContextReturns whether this context has a value associated with the given class.- Specified by:
containsKeyin interfaceIContext- Parameters:
clazz- the class being queried (notnull)- Returns:
trueif this context has a value for the given class, andfalseotherwise
-