public class Contexts
extends java.lang.Object
IContext
s.Modifier and Type | Field and Description |
---|---|
static IContext |
EMPTY_CONTEXT
The empty context (immutable).
|
Modifier and Type | Method and Description |
---|---|
static <T> IContext |
of(java.lang.Class<T> clazz,
T value)
Returns an immutable context containing only the given class-value
binding.
|
static <T> IContext |
of(Property<T> property,
T value)
Returns an immutable context containing only the given property-value
binding.
|
static IContext |
with(IContext... contexts)
Returns a new context that combines the given contexts in the specified
order.
|
static IContext |
with(java.util.List<IContext> contexts)
Returns a new context that combines the given contexts in the specified
order.
|
public static final IContext EMPTY_CONTEXT
public static <T> IContext of(Property<T> property, T value)
T
- type of valueproperty
- not null
value
- may be null
null
)public static <T> IContext of(java.lang.Class<T> clazz, T value)
T
- type of valueclazz
- not null
value
- may be null
null
)public static IContext with(IContext... contexts)
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.
contexts
- the contexts to combinenull
)public static IContext with(java.util.List<IContext> contexts)
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.
contexts
- the contexts to combinenull
)Copyright (c) 2014, 2019 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0