Package org.eclipse.handly.context
Class Contexts
java.lang.Object
org.eclipse.handly.context.Contexts
Provides static utility methods for creating and operating on
IContext
s.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> IContext
Returns an immutable context containing only the given class-value binding.static <T> IContext
Returns an immutable context containing only the given property-value binding.static IContext
Returns a new context that combines the given contexts in the specified order.static IContext
Returns a new context that combines the given contexts in the specified order.
-
Field Details
-
EMPTY_CONTEXT
The empty context (immutable).
-
-
Method Details
-
of
Returns an immutable context containing only the given property-value binding.- Type Parameters:
T
- type of value- Parameters:
property
- notnull
value
- may benull
- Returns:
- an immutable context containing only the given property-value
binding (never
null
)
-
of
Returns an immutable context containing only the given class-value binding.- Type Parameters:
T
- type of value- Parameters:
clazz
- notnull
value
- may benull
- Returns:
- an immutable context containing only the given class-value
binding (never
null
)
-
with
Returns a new context that combines the given contexts in the specified order.The returned context is immutable provided that each of the given contexts is immutable. If some of the given contexts are not immutable, the returned context is neither immutable nor thread-safe.
- Parameters:
contexts
- the contexts to combine- Returns:
- the combined context (never
null
)
-
with
Returns a new context that combines the given contexts in the specified order.The returned context is immutable provided that each of the given contexts is immutable. If some of the given contexts are not immutable, the returned context is neither immutable nor thread-safe.
- Parameters:
contexts
- the contexts to combine- Returns:
- the combined context (never
null
)
-