Package org.eclipse.emfforms.bazaar
Class BazaarContext.Builder
- java.lang.Object
-
- org.eclipse.emfforms.bazaar.BazaarContext.Builder
-
- Enclosing interface:
- BazaarContext
public static final class BazaarContext.Builder extends java.lang.ObjectA fluent builder ofBazaarContexts.- Author:
- Christian W. Damus
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BazaarContext.Builderadd(java.lang.Object value)Adds a self-typed context value.BazaarContextbuild()Create the bazaar context.static BazaarContext.Builderempty()Creates a new empty context builder.<T> BazaarContext.Builderput(java.lang.Class<T> key, T value)Adds a context value of the given type.BazaarContext.Builderput(java.lang.String name, java.lang.Object value)Adds a context value for the given name, such as might be used with named injection.static BazaarContext.Builderwith(java.util.Map<java.lang.String,?> values)Creates a new context builder with the given initialvalues.
-
-
-
Method Detail
-
empty
public static BazaarContext.Builder empty()
Creates a new empty context builder.- Returns:
- an initially empty builder
-
with
public static BazaarContext.Builder with(java.util.Map<java.lang.String,?> values)
Creates a new context builder with the given initialvalues.- Parameters:
values- initial context values- Returns:
- an initialized builder
-
put
public <T> BazaarContext.Builder put(java.lang.Class<T> key, T value)
Adds a context value of the given type.- Type Parameters:
T- the value type- Parameters:
key- the contextvalue's typevalue- the context value- Returns:
- this builder
-
add
public BazaarContext.Builder add(java.lang.Object value)
Adds a self-typed context value.- Parameters:
value- the context value to add- Returns:
- this builder
- Throws:
java.lang.NullPointerException- if thevalueisnull- See Also:
put(Class, Object)
-
put
public BazaarContext.Builder put(java.lang.String name, java.lang.Object value)
Adds a context value for the given name, such as might be used with named injection.- Parameters:
name- the contextvalue's namevalue- the context value- Returns:
- this builder
- See Also:
Named
-
build
public BazaarContext build()
Create the bazaar context. Further updates to the builder will have no effect on the resulting context.- Returns:
- the bazaar context
-
-