Interface TypedMoney
- All Known Subinterfaces:
HighPrecisionMoney
,Money
- All Known Implementing Classes:
HighPrecisionMoneyImpl
,MoneyImpl
,TypedMoneyImpl
public interface TypedMoney
TypedMoney
Example to create a subtype instance using the builder pattern
Example to create a subtype instance using the builder pattern
TypedMoney typedMoney = TypedMoney.highPrecisionBuilder()
centAmount(0.3)
currencyCode("{currencyCode}")
preciseAmount(0.3)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic MoneyBuilder
builder for centPrecision subtypestatic TypedMoney
deepCopy
(TypedMoney template) factory method to create a deep copy of TypedMoney@NotNull Long
@NotNull String
The currency code compliant to ISO 4217.@NotNull MoneyType
getType()
static HighPrecisionMoneyBuilder
builder for highPrecision subtypevoid
setCentAmount
(Long centAmount) set centAmountvoid
setCurrencyCode
(String currencyCode) The currency code compliant to ISO 4217.void
setFractionDigits
(Integer fractionDigits) set fractionDigitsstatic com.fasterxml.jackson.core.type.TypeReference<TypedMoney>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withTypedMoney
(Function<TypedMoney, T> helper) accessor map function
-
Method Details
-
getType
- Returns:
- type
-
getFractionDigits
Integer getFractionDigits()- Returns:
- fractionDigits
-
getCentAmount
- Returns:
- centAmount
-
getCurrencyCode
The currency code compliant to ISO 4217.
- Returns:
- currencyCode
-
setFractionDigits
set fractionDigits- Parameters:
fractionDigits
- value to be set
-
setCentAmount
set centAmount- Parameters:
centAmount
- value to be set
-
setCurrencyCode
The currency code compliant to ISO 4217.
- Parameters:
currencyCode
- value to be set
-
deepCopy
factory method to create a deep copy of TypedMoney- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
highPrecisionBuilder
builder for highPrecision subtype- Returns:
- builder
-
centPrecisionBuilder
builder for centPrecision subtype- Returns:
- builder
-
withTypedMoney
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
-