Package org.eclipse.handly.context
Interface IContext
- All Known Implementing Classes:
Context,GuiceContext
public interface IContext
-
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.default <T> TgetOrDefault(Property<T> property) Returns the context value associated with the given property; if no value is associated with the given property, returns the default value of the property.
-
Method Details
-
get
Returns the context value associated with the given property.- Parameters:
property- the property being queried (notnull)- Returns:
- an object corresponding to the given property, or
null
-
getOrDefault
Returns the context value associated with the given property; if no value is associated with the given property, returns the default value of the property.This implementation makes no guarantees about synchronization or atomicity.
- Parameters:
property- the property being queried (notnull)- Returns:
- an object corresponding to the given property, or the property's
default value (may be
null) - See Also:
-
get
Returns the context value associated with the given class.- Parameters:
clazz- the class being queried (notnull)- Returns:
- an object corresponding to the given class, or
null
-
containsKey
Returns whether this context has a value associated with the given property.- Parameters:
property- the property being queried (notnull)- Returns:
trueif this context has a value for the given property, andfalseotherwise
-
containsKey
Returns whether this context has a value associated with the given class.- Parameters:
clazz- the class being queried (notnull)- Returns:
trueif this context has a value for the given class, andfalseotherwise
-