public class PriceBuilder extends Object
Constructor and Description |
---|
PriceBuilder(Dummy4j dummy4j) |
Modifier and Type | Method and Description |
---|---|
String |
build()
Generates a random price
|
PriceBuilder |
high()
Sets limits on a randomly generated price from 100 to 10,000.
|
PriceBuilder |
withCurrency(String customCurrency)
Sets the currency that will be added to the generated price.
|
PriceBuilder |
withinRange(float min,
float max)
Sets limits on a randomly generated price from
min to max . |
PriceBuilder |
withoutCurrency()
The price will be generated without any currency.
|
PriceBuilder |
withRandomCurrency()
Sets a random currency that will be added to the generated price.
|
PriceBuilder |
withRandomCurrency(String... currencies)
Sets a currency that will be added to the generated price to one that is randomly chosen from provided arguments.
|
public PriceBuilder(Dummy4j dummy4j)
public PriceBuilder withCurrency(String customCurrency)
EUR 12.35
.
The currency code will be placed before the amount.
public PriceBuilder withRandomCurrency()
JPY 12.35
.
The currency code will be placed before the amount.
public PriceBuilder withRandomCurrency(String... currencies)
JPY 12.35
.
The currency code will be placed before the amount.
public PriceBuilder withoutCurrency()
12.35
.
This is the default behavior for this builder.
public PriceBuilder high()
1234.56
public PriceBuilder withinRange(float min, float max)
min
to max
.
E.g. 1234.56
public String build()
Copyright © 2021. All rights reserved.