Interface ModelDataMapper

All Known Implementing Classes:
ConverterModelDataMapper

public interface ModelDataMapper
Maps platform model to/from DTO
  • Method Summary

    Modifier and Type
    Method
    Description
    <S, T> Class<S>
    getSourceType(com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager, Class<? extends T> targetClass)
    Looks for source class for provided target type.
    <S, T> T
    map(com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager, S model)
    Maps provided object into its proper representation (DTO into platform model or another way round)
    <T> void
    map(com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager, T target, Map<String,Object> values)
    Maps provided values with proper fields in provided target object
  • Method Details

    • map

      <T> void map(com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager, T target, Map<String,Object> values)
      Maps provided values with proper fields in provided target object
      Type Parameters:
      T - type of target model
      Parameters:
      widgetInstanceManager - widget instance manager for widget that requested mapping
      target - target object, which fields should be mapped
      values - values to map
    • map

      <S, T> T map(com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager, S model)
      Maps provided object into its proper representation (DTO into platform model or another way round)
      Type Parameters:
      S - type of source object
      T - type of target object
      Parameters:
      widgetInstanceManager - widget instance manager for widget that requested mapping
      model - object to be mapped
      Returns:
      object with mapped values
    • getSourceType

      <S, T> Class<S> getSourceType(com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager, Class<? extends T> targetClass)
      Looks for source class for provided target type.
      Type Parameters:
      S - type of source object
      T - type of target source
      Parameters:
      widgetInstanceManager - widget instance manager for widget that requested mapping
      targetClass - mapping target class
      Returns:
      class that would be mapped into provided target class or null, if mapper is unable to map anything into provided tagert class