Interface Money
public interface Money
Money
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Money money = Money.builder()
.currencyCode("{currencyCode}")
.centAmount(1)
.fractionDigits(1)
.type(MoneyType.CENT_PRECISION)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic MoneyBuilder
builder()
builder factory method for Moneystatic MoneyBuilder
create builder for Money instancestatic Money
factory method to create a deep copy of Money@NotNull Integer
@NotNull String
Currency code compliant to ISO 4217.@NotNull Integer
@NotNull MoneyType
getType()
static Money
of()
factory methodstatic Money
factory method to create a shallow copy Moneyvoid
setCentAmount
(Integer centAmount) set centAmountvoid
setCurrencyCode
(String currencyCode) Currency code compliant to ISO 4217.void
setFractionDigits
(Integer fractionDigits) set fractionDigitsvoid
set typestatic com.fasterxml.jackson.core.type.TypeReference<Money>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map function
-
Method Details
-
getCurrencyCode
Currency code compliant to ISO 4217.
- Returns:
- currencyCode
-
getCentAmount
- Returns:
- centAmount
-
getFractionDigits
- Returns:
- fractionDigits
-
getType
- Returns:
- type
-
setCurrencyCode
Currency code compliant to ISO 4217.
- Parameters:
currencyCode
- value to be set
-
setCentAmount
set centAmount- Parameters:
centAmount
- value to be set
-
setFractionDigits
set fractionDigits- Parameters:
fractionDigits
- value to be set
-
setType
set type- Parameters:
type
- value to be set
-
of
factory method- Returns:
- instance of Money
-
of
factory method to create a shallow copy Money- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of Money- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for Money- Returns:
- builder
-
builder
create builder for Money instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withMoney
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-