Package org.eclipse.handly.context
Class Context
java.lang.Object
org.eclipse.handly.context.Context
- All Implemented Interfaces:
IContext
Implementation of
IContext
that is based on explicit bindings and
does not allow re-binding. It is illegal to bind a key that has already
been bound.-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Associates a value with a key in this context. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> Context.BindingBuilder<T>
Returns a binding builder for the given class.<T> Context.BindingBuilder<T>
Returns a binding builder for the given property.boolean
containsKey
(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
Returns the context value associated with the given class.<T> T
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
-
Constructor Details
-
Context
public Context()
-
-
Method Details
-
get
Description copied from interface:IContext
Returns the context value associated with the given property. -
get
Description copied from interface:IContext
Returns the context value associated with the given class. -
containsKey
Description copied from interface:IContext
Returns whether this context has a value associated with the given property.- Specified by:
containsKey
in interfaceIContext
- Parameters:
property
- the property being queried (notnull
)- Returns:
true
if this context has a value for the given property, andfalse
otherwise
-
containsKey
Description copied from interface:IContext
Returns whether this context has a value associated with the given class.- Specified by:
containsKey
in interfaceIContext
- Parameters:
clazz
- the class being queried (notnull
)- Returns:
true
if this context has a value for the given class, andfalse
otherwise
-
bind
Returns a binding builder for the given property.- Parameters:
property
- the property to bind (notnull
)- Returns:
- a binding builder (never
null
)
-
bind
Returns a binding builder for the given class.- Parameters:
clazz
- the class to bind (notnull
)- Returns:
- a binding builder (never
null
)
-