Class AbstractMapper
java.lang.Object
es.kukenan.smartfi.microservice.contracts.service.mapper.AbstractMapper
- Direct Known Subclasses:
AbstractCoreMapper
Abstract common operations mapper.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String€ currency identifier.protected static final DateTimeFormatterFormatter to support invalid 20170523T00:00:00Z date time with time zone string.protected static final StringPreferred number format to use, as more than one can be received in accounts. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected es.kukenan.smartfi.microservice.contracts.api.movement.MovementDtocreateDefault(String id, String reason, String subsystem, String operationDate, es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Balance balance, es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Balance amount, String valueDate, es.kukenan.smartfi.microservice.backoffice.dtos.core.common.GenericIdName type) Create a ProductDto with default data.protected es.kukenan.smartfi.microservice.contracts.api.common.AmountDtoextractAmount(es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Balance balance) Extract the SkyLine AmountDto from the given Balance.protected es.kukenan.smartfi.microservice.contracts.api.common.CurrencyDtoextractCurrency(es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Currency currency) Extract the SkyLine CurrencyDto from the given Currency.protected es.kukenan.smartfi.microservice.contracts.api.common.IdNamePairDtoextractIdNamePair(es.kukenan.smartfi.microservice.backoffice.dtos.core.common.GenericIdName genericIdName) Extract the SkyLine IdNamePairDto from the given GenericIdName.protected booleanextractIsCurrency(es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Currency currency) Extract if currency is euro.protected LocalDateextractLocalDate(String date) LocalDateparser wrapper that supports two formats: ISO 8601 local date and ISO 8601 full date.protected LocalDateTimeextractLocalDateTime(String date) LocalDateTimeparser wrapper that supports two formats: ISO 8601 local date and ISO 8601 full date.protected es.kukenan.smartfi.microservice.contracts.api.products.ProductNumberDtoextractProductNum(List<es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Format> formats) Extract the product number from the given format list, using the configured preferred format if present.protected es.kukenan.smartfi.microservice.contracts.api.common.SignatureDtoextractSignature(es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Signature signature) Extract the signature information.
-
Field Details
-
PREFERRED_NUMBER_FORMAT
Preferred number format to use, as more than one can be received in accounts.- See Also:
-
CURRENCY_EUR
€ currency identifier.- See Also:
-
invalidFormatFormatter
Formatter to support invalid 20170523T00:00:00Z date time with time zone string.
-
-
Constructor Details
-
AbstractMapper
public AbstractMapper()
-
-
Method Details
-
extractAmount
protected es.kukenan.smartfi.microservice.contracts.api.common.AmountDto extractAmount(es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Balance balance) Extract the SkyLine AmountDto from the given Balance.- Parameters:
balance- Balance.- Returns:
- SkyLine AmountDto.
-
extractIdNamePair
protected es.kukenan.smartfi.microservice.contracts.api.common.IdNamePairDto extractIdNamePair(es.kukenan.smartfi.microservice.backoffice.dtos.core.common.GenericIdName genericIdName) Extract the SkyLine IdNamePairDto from the given GenericIdName.- Parameters:
genericIdName- GenericIdName.- Returns:
- SkyLine IdNamePairDto.
-
extractIsCurrency
protected boolean extractIsCurrency(es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Currency currency) Extract if currency is euro.- Parameters:
currency- Currency.- Returns:
- Flag to indicate if it is euro.
-
extractCurrency
protected es.kukenan.smartfi.microservice.contracts.api.common.CurrencyDto extractCurrency(es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Currency currency) Extract the SkyLine CurrencyDto from the given Currency.- Parameters:
currency- Currency.- Returns:
- SkyLine CurrencyDto.
-
extractProductNum
protected es.kukenan.smartfi.microservice.contracts.api.products.ProductNumberDto extractProductNum(List<es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Format> formats) Extract the product number from the given format list, using the configured preferred format if present.- Parameters:
formats- Core format list.- Returns:
- product number.
-
extractLocalDate
LocalDateparser wrapper that supports two formats: ISO 8601 local date and ISO 8601 full date.- Parameters:
date- a given date string (local of full ISO 8601 date).- Returns:
LocalDateinstance or null if the given date is null.
-
extractLocalDateTime
LocalDateTimeparser wrapper that supports two formats: ISO 8601 local date and ISO 8601 full date.- Parameters:
date- a given date string (local of full ISO 8601 date).- Returns:
LocalDateTimeinstance or null if the given date is null.
-
extractSignature
protected es.kukenan.smartfi.microservice.contracts.api.common.SignatureDto extractSignature(es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Signature signature) Extract the signature information.- Parameters:
signature- format list.- Returns:
- signature dto.
-
createDefault
protected es.kukenan.smartfi.microservice.contracts.api.movement.MovementDto createDefault(String id, String reason, String subsystem, String operationDate, es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Balance balance, es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Balance amount, String valueDate, es.kukenan.smartfi.microservice.backoffice.dtos.core.common.GenericIdName type) Create a ProductDto with default data. This method has been added for convenience, to have an starting Dto with common information filled.- Parameters:
id- product id.reason- reason.subsystem- product subsystem.operationDate- Core movement date operation.balance- Core movement balance.amount- Core movement amount.valueDate- Core movement valueDate.type- Core movement type.- Returns:
- ProductDto with default data.
-