Package org.eclipse.handly.context
Class Context
- java.lang.Object
-
- org.eclipse.handly.context.Context
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classContext.BindingBuilder<T>Associates a value with a key in this context.
-
Constructor Summary
Constructors Constructor Description Context()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Context.BindingBuilder<T>bind(java.lang.Class<T> clazz)Returns a binding builder for the given class.<T> Context.BindingBuilder<T>bind(Property<T> property)Returns a binding builder for the given property.booleancontainsKey(java.lang.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> Tget(java.lang.Class<T> clazz)Returns the context value associated with the given class.<T> Tget(Property<T> property)Returns 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, wait
-
Methods inherited from interface org.eclipse.handly.context.IContext
getOrDefault
-
-
-
-
Method Detail
-
get
public <T> T get(Property<T> property)
Description copied from interface:IContextReturns the context value associated with the given property.
-
get
public <T> T get(java.lang.Class<T> clazz)
Description copied from interface:IContextReturns the context value associated with the given class.
-
containsKey
public boolean containsKey(Property<?> property)
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
public boolean containsKey(java.lang.Class<?> clazz)
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
-
bind
public <T> Context.BindingBuilder<T> bind(Property<T> property)
Returns a binding builder for the given property.- Parameters:
property- the property to bind (notnull)- Returns:
- a binding builder (never
null)
-
bind
public <T> Context.BindingBuilder<T> bind(java.lang.Class<T> clazz)
Returns a binding builder for the given class.- Parameters:
clazz- the class to bind (notnull)- Returns:
- a binding builder (never
null)
-
-