Modifier and Type | Method and Description |
---|---|
Bazaar.Builder<T> |
add(Vendor<? extends T> vendor)
Adds a vendor.
|
Bazaar.Builder<T> |
add(Vendor<? extends T> vendor1,
Vendor<? extends T> vendor2,
Vendor<? extends T>... more)
Adds vendors.
|
Bazaar.Builder<T> |
addAll(Collection<? extends Vendor<? extends T>> vendors)
Adds vendors.
|
Bazaar.Builder<T> |
addContextFunction(Class<?> type,
BazaarContextFunction contextFunction)
Add a context function.
|
Bazaar.Builder<T> |
addContextFunction(String key,
BazaarContextFunction contextFunction)
Add a context function.
|
Bazaar<T> |
build()
Create the bazaar.
|
static <T> Bazaar.Builder<T> |
empty()
Creates a new empty bazaar builder.
|
Bazaar.Builder<T> |
onPriorityOverlap(Bazaar.PriorityOverlapCallBack<? super T> overlapHandler)
Set the handler for priority overlaps.
|
Bazaar.Builder<T> |
threadSafe()
Request that the bazaar be thread-safe.
|
static <T> Bazaar.Builder<T> |
with(Collection<? extends Vendor<? extends T>> vendors)
Creates a new bazaar builder with the given initial
vendors . |
public static <T> Bazaar.Builder<T> empty()
T
- the type of product provided by the Bazaar
public static <T> Bazaar.Builder<T> with(Collection<? extends Vendor<? extends T>> vendors)
vendors
.T
- the type of product provided by the Bazaar
vendors
- initial vendorspublic Bazaar.Builder<T> add(Vendor<? extends T> vendor)
vendor
- the vendor to addpublic Bazaar.Builder<T> add(Vendor<? extends T> vendor1, Vendor<? extends T> vendor2, Vendor<? extends T>... more)
vendor1
- a vendor to addvendor2
- another vendor to addmore
- optional additional vendors to addpublic Bazaar.Builder<T> addAll(Collection<? extends Vendor<? extends T>> vendors)
vendors
- vendors to addpublic Bazaar.Builder<T> addContextFunction(Class<?> type, BazaarContextFunction contextFunction)
type
- the context value type provided by the functioncontextFunction
- the context function to addBazaar.Builder
public Bazaar.Builder<T> addContextFunction(String key, BazaarContextFunction contextFunction)
key
- the context key for the functioncontextFunction
- the context function to addBazaar.Builder
public Bazaar.Builder<T> onPriorityOverlap(Bazaar.PriorityOverlapCallBack<? super T> overlapHandler)
overlapHandler
- the overlap handler to setpublic Bazaar.Builder<T> threadSafe()
Copyright © 2018. All rights reserved.