java.lang.Object
es.kukenan.smartfi.microservice.contracts.service.mapper.AbstractMapper
Direct Known Subclasses:
AbstractCoreMapper

public abstract class AbstractMapper extends Object
Abstract common operations mapper.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final String
    € currency identifier.
    protected static final DateTimeFormatter
    Formatter to support invalid 20170523T00:00:00Z date time with time zone string.
    protected static final String
    Preferred number format to use, as more than one can be received in accounts.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
    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.
    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.
    protected boolean
    extractIsCurrency(es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Currency currency)
    Extract if currency is euro.
    protected LocalDate
    LocalDate parser wrapper that supports two formats: ISO 8601 local date and ISO 8601 full date.
    protected LocalDateTime
    LocalDateTime parser wrapper that supports two formats: ISO 8601 local date and ISO 8601 full date.
    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.
    protected es.kukenan.smartfi.microservice.contracts.api.common.SignatureDto
    extractSignature(es.kukenan.smartfi.microservice.backoffice.dtos.core.common.Signature signature)
    Extract the signature information.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PREFERRED_NUMBER_FORMAT

      protected static final String PREFERRED_NUMBER_FORMAT
      Preferred number format to use, as more than one can be received in accounts.
      See Also:
    • CURRENCY_EUR

      protected static final String CURRENCY_EUR
      € currency identifier.
      See Also:
    • invalidFormatFormatter

      protected static final DateTimeFormatter 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

      protected LocalDate extractLocalDate(String date)
      LocalDate parser 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:
      LocalDate instance or null if the given date is null.
    • extractLocalDateTime

      protected LocalDateTime extractLocalDateTime(String date)
      LocalDateTime parser 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:
      LocalDateTime instance 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.