Interface DataFeedElementTransformer<S,D>

Type Parameters:
S - see getSourceElementType()
D - see getDestinationElementType()
All Superinterfaces:
org.springframework.core.Ordered
All Known Implementing Classes:
CollectedProductToCommerceManagerFeedCSVProductTransformer, CollectedProductToMerchantCenterXMLProductTransformer

public interface DataFeedElementTransformer<S,D> extends org.springframework.core.Ordered
A component capable of converting POJO elements from source data into POJO elements of output data.
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    The type of element that will be returned as conversion output.
    default int
     
    The type of element that will be accepted as input for conversion.
    transform(List<S> sourceElements, DataFeedPublishRequestDetails publishRequestDetails)
    Convert the list of source elements into destination elements.
  • Method Details

    • getSourceElementType

      Class<S> getSourceElementType()
      The type of element that will be accepted as input for conversion.
    • getDestinationElementType

      Class<D> getDestinationElementType()
      The type of element that will be returned as conversion output.
    • transform

      @Nullable List<D> transform(List<S> sourceElements, DataFeedPublishRequestDetails publishRequestDetails)
      Convert the list of source elements into destination elements.

      Note that this method contract does not impose any requirement that there is a 1:1 mapping from source element to destination element. One input element can result in 0 or more output elements depending on arbitrary criteria.

      Parameters:
      sourceElements - a list of source elements to convert into destination elements
      publishRequestDetails - request details around the publish process
      Returns:
      a list of converted destination elements. This can be null if no conversion is possible.
    • getOrder

      default int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered