Package org.cyclos.impl.banking
Interface DRateTypeHandler
-
- All Superinterfaces:
RateTypeHandler<Date,DRateParameters,DRateParametersDTO>,TimeBasedRateTypeHandler<DRateParameters,DRateParametersDTO>
public interface DRateTypeHandler extends TimeBasedRateTypeHandler<DRateParameters,DRateParametersDTO>
Handler for D-rate
-
-
Field Summary
-
Fields inherited from interface org.cyclos.impl.banking.RateTypeHandler
RATE_SCALE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapplyMaturityPolicyChangesForFrom(TransferType transferType, BigDecimal amount, RatesData originalRates, FromRatesData result)applies the maturity policy to the result parameter.voidtoEntity(TransferType tt, DRateCreationValueForTransferTypeDTO dto)Sets the DRateCreationValueForTransferType from the dto to the transferType entity.-
Methods inherited from interface org.cyclos.impl.banking.RateTypeHandler
applyIncomingTransfer, calculateFromRates, complete, convert, convert, copy, getCreationValue, getEnableDate, getNullSafeRawRate, getRateParameters, getRateParameters, getRateParametersDTO, getRateType, isEnabled, isVisible, isVisibleToUser, nullAllAccountRates, resolveValidator, setRate, setRawRate, toEntity
-
Methods inherited from interface org.cyclos.impl.banking.TimeBasedRateTypeHandler
convert, convert, getInitValue
-
-
-
-
Method Detail
-
applyMaturityPolicyChangesForFrom
void applyMaturityPolicyChangesForFrom(TransferType transferType, BigDecimal amount, RatesData originalRates, FromRatesData result)
applies the maturity policy to the result parameter. If the policy is different from MaturityPolicy.ALWAYS, and if there is a positive dRate, then the following is done:- check if no units are created for the transfer because of going deeper into minus. If so an IllegalArgumentException is thrown.
- calculate what higher D-rates will be left to the account after paying with D-rate is zero, and set that as the D-rate to the result.
- set appropriate fields to the result param.
- Parameters:
transferType-amount- the transfer amountoriginalRates- - the rates as they were before applying the transfer.result- - the FromRatesData object representing the results for the from account, after applying the transfer.
-
toEntity
void toEntity(TransferType tt, DRateCreationValueForTransferTypeDTO dto)
Sets the DRateCreationValueForTransferType from the dto to the transferType entity. method does the following:- checks if the rate parameters have been changed
-
-