Add adavanced config and properties build for money
This commit is contained in:
@@ -4,4 +4,19 @@ fun StdMoney.exchangeTo(currency: StdMoney.Currency): StdMoney {
|
||||
return MoneyExchangeUtils.exchange(this, currency)
|
||||
}
|
||||
|
||||
fun StdMoney.isMatchedCurrency(currency: StdMoney.Currency) = this.getMoneyCurrency().getCurrency().equals(currency.getCurrency(), ignoreCase = true)
|
||||
fun StdMoney.isMatchedCurrency(currency: StdMoney.Currency) =
|
||||
this.getMoneyCurrency().getCurrency().equals(currency.getCurrency(), ignoreCase = true)
|
||||
|
||||
inline fun buildMoneyConfigProperties(
|
||||
builderAction: MoneyConfig.MoneyConfigProperties.MoneyConfigPropertiesBuilder.() -> Unit
|
||||
): MoneyConfig.MoneyConfigProperties {
|
||||
return MoneyConfig
|
||||
.builder().apply(builderAction)
|
||||
.build()
|
||||
}
|
||||
|
||||
inline fun applyMoneyConfig(
|
||||
builderAction: MoneyConfig.() -> Unit,
|
||||
) {
|
||||
MoneyConfig.apply(builderAction)
|
||||
}
|
||||
Reference in New Issue
Block a user