public final class ProviderContextBuilder extends AbstractContextBuilder<ProviderContextBuilder,ProviderContext>
ProviderContext
instances. Instances of
this class are not thread-safe.Modifier and Type | Method and Description |
---|---|
ProviderContext |
build()
Creates a new
ProviderContext with the data from this Builder
instance. |
static ProviderContextBuilder |
create(ProviderContext context)
Create a new ProviderContextBuilder, hereby using the given
ProviderContext
's values as defaults. |
static ProviderContextBuilder |
of(String provider,
Collection<RateType> rateTypes)
Create a new ProviderContextBuilder instance.
|
static ProviderContextBuilder |
of(String provider,
RateType rateType,
RateType... rateTypes)
Create a new ProviderContextBuilder instance.
|
ProviderContextBuilder |
setRateTypes(Collection<RateType> rateTypes)
Set the rate types.
|
ProviderContextBuilder |
setRateTypes(RateType... rateTypes)
Set the rate types.
|
importContext, importContext, removeAttributes, set, set, set, set, set, set, set, set, set, setProviderName, toString
public ProviderContextBuilder setRateTypes(RateType... rateTypes)
rateTypes
- the rate types, not null and not empty.IllegalArgumentException
- when not at least one RateType
is provided.public ProviderContextBuilder setRateTypes(Collection<RateType> rateTypes)
rateTypes
- the rate types, not null and not empty.IllegalArgumentException
- when not at least one RateType
is provided.public ProviderContext build()
ProviderContext
with the data from this Builder
instance.build
in class AbstractContextBuilder<ProviderContextBuilder,ProviderContext>
ProviderContext
. never null
.public static ProviderContextBuilder create(ProviderContext context)
ProviderContext
's values as defaults. This allows changing an existing
ProviderContext
easily.context
- the context, not null
ProviderContextBuilder
instance, never null.public static ProviderContextBuilder of(String provider, RateType rateType, RateType... rateTypes)
provider
- the provider name, not null
.rateTypes
- the rate types, not null and not empty.ProviderContextBuilder
instance, never null.public static ProviderContextBuilder of(String provider, Collection<RateType> rateTypes)
provider
- the provider name, not null
.rateTypes
- the rate types, not null and not empty.ProviderContextBuilder
instance, never null.Copyright © 2012–2016 JSR 354 - Expert Group. All rights reserved.