Top Description Constructors Methods
javax.money.convert

public final Class ProviderContextBuilder

extends AbstractContextBuilder<ProviderContextBuilder, ProviderContext>
Class Inheritance
Imports
javax.money.AbstractContextBuilder, java.util.*

Builder class to of ProviderContext instances. Instances of this class are not thread-safe.
Author
Anatole Tresch

Constructor Summary

AccessConstructor and Description
private
ProviderContextBuilder(String
the provider name, not null.
provider
,
RateType rateType, RateType...
the rate types, not null and not empty.
rateTypes
)

Create a new Builder instance.

private
ProviderContextBuilder(String
the provider name, not null.
provider
,
Collection<RateType>
the rate types, not null and not empty.
rateTypes
)

Create a new Builder instance.

private
ProviderContextBuilder(ProviderContext
the context, not null
context
)

Create a new Builder, hereby using the given ProviderContext 's values as defaults.

Method Summary

Modifier and TypeMethod and Description
public ProviderContext

Returns:

a new ProviderContext. never null.
build
()

Implements abstract javax.money.AbstractContextBuilder.build.

Creates a new ProviderContext with the data from this Builder instance.
public static ProviderContextBuilder

Returns:

a new javax.money.convert.ProviderContextBuilder instance, never null.
create
(ProviderContext
the context, not null
context
)

Create a new ProviderContextBuilder, hereby using the given ProviderContext 's values as defaults.

public static ProviderContextBuilder

Returns:

a new javax.money.convert.ProviderContextBuilder instance, never null.
of
(String
the provider name, not null.
provider
,
RateType
the required RateType, not null
rateType
,
RateType...
the rate types, not null and not empty.
rateTypes
)

Create a new ProviderContextBuilder instance.

public static ProviderContextBuilder

Returns:

a new javax.money.convert.ProviderContextBuilder instance, never null.
of
(String
the provider name, not null.
provider
,
Collection<RateType>
the rate types, not null and not empty.
rateTypes
)

Create a new ProviderContextBuilder instance.

public ProviderContextBuilder

Returns:

this, for chaining.
setRateTypes
(RateType...
the rate types, not null and not empty.
rateTypes
)

Set the rate types.

public ProviderContextBuilder

Returns:

this, for chaining.
setRateTypes
(Collection<RateType>
the rate types, not null and not empty.
rateTypes
)

Set the rate types.

Inherited from javax.money.AbstractContextBuilder:
importContextimportContextremoveAttributessetsetsetsetsetsetsetsetsetsetProviderNametoString

Constructor Detail

ProviderContextBuilderback to summary
private ProviderContextBuilder(String provider, RateType rateType, RateType... rateTypes)

Create a new Builder instance.

Parameters
provider:String

the provider name, not null.

rateTypes:RateType[]

the rate types, not null and not empty.

ProviderContextBuilderback to summary
private ProviderContextBuilder(String provider, Collection<RateType> rateTypes)

Create a new Builder instance.

Parameters
provider:String

the provider name, not null.

rateTypes:Collection<RateType>

the rate types, not null and not empty.

ProviderContextBuilderback to summary
private ProviderContextBuilder(ProviderContext context)

Create a new Builder, hereby using the given ProviderContext 's values as defaults. This allows changing an existing ProviderContext easily.

Parameters
context:ProviderContext

the context, not null

Method Detail

buildback to summary
public ProviderContext build()

Implements abstract javax.money.AbstractContextBuilder.build.

Creates a new ProviderContext with the data from this Builder instance.

Returns:ProviderContext

a new ProviderContext. never null.

createback to summary
public static ProviderContextBuilder create(ProviderContext context)

Create a new ProviderContextBuilder, hereby using the given ProviderContext 's values as defaults. This allows changing an existing ProviderContext easily.

Parameters
context:ProviderContext

the context, not null

Returns:ProviderContextBuilder

a new javax.money.convert.ProviderContextBuilder instance, never null.

ofback to summary
public static ProviderContextBuilder of(String provider, RateType rateType, RateType... rateTypes)

Create a new ProviderContextBuilder instance.

Parameters
provider:String

the provider name, not null.

rateType:RateType

the required RateType, not null

rateTypes:RateType[]

the rate types, not null and not empty.

Returns:ProviderContextBuilder

a new javax.money.convert.ProviderContextBuilder instance, never null.

ofback to summary
public static ProviderContextBuilder of(String provider, Collection<RateType> rateTypes)

Create a new ProviderContextBuilder instance.

Parameters
provider:String

the provider name, not null.

rateTypes:Collection<RateType>

the rate types, not null and not empty.

Returns:ProviderContextBuilder

a new javax.money.convert.ProviderContextBuilder instance, never null.

setRateTypesback to summary
public ProviderContextBuilder setRateTypes(RateType... rateTypes)

Set the rate types.

Parameters
rateTypes:RateType[]

the rate types, not null and not empty.

Returns:ProviderContextBuilder

this, for chaining.

Exceptions
IllegalArgumentException:
when not at least one RateType is provided.
setRateTypesback to summary
public ProviderContextBuilder setRateTypes(Collection<RateType> rateTypes)

Set the rate types.

Parameters
rateTypes:Collection<RateType>

the rate types, not null and not empty.

Returns:ProviderContextBuilder

this, for chaining.

Exceptions
IllegalArgumentException:
when not at least one RateType is provided.