Package org.eclipse.handly.context
Interface IContext
- All Known Implementing Classes:
Context
,GuiceContext
public interface IContext
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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.default <T> T
getOrDefault
(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:
true
if this context has a value for the given property, andfalse
otherwise
-
containsKey
Returns whether this context has a value associated with the given class.- Parameters:
clazz
- the class being queried (notnull
)- Returns:
true
if this context has a value for the given class, andfalse
otherwise
-