Class AbstractDataToWsConverter<DATA,​WSDTO>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String fields  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.function.Predicate<java.lang.Object> canConvert()
      Predicate to verify whether the convert method can be used or not.
      WSDTO convert​(DATA source, java.lang.String fields)
      Method to convert a source object to a target object.
      java.util.Collection<java.lang.Object> convertCollection​(java.util.Collection<java.lang.Object> source)
      Converts collection that contains data objects to a collection that contains ws objects.
      java.util.Map<java.lang.String,​java.lang.Object> convertMap​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Convert a map that contains data objects to a map that contains ws objects.
      java.lang.Object convertPrimitive​(java.lang.Object source)
      Converts primitives from source to target
      void customize​(ma.glasnost.orika.MapperFactory factory)
      Method to customize conversion between source and target object.
      protected CMSDataMapper getMapper()  
      protected static boolean isCollection​(java.lang.Object valueObj)
      Method tests whether the Object is a Collection.
      protected static boolean isMap​(java.lang.Object valueObj)
      Method tests whether the Object is a Map.
      void setMapper​(CMSDataMapper mapper)  
      • Methods inherited from class java.lang.Object

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

      • fields

        protected java.lang.String fields
    • Constructor Detail

      • AbstractDataToWsConverter

        public AbstractDataToWsConverter()
    • Method Detail

      • convert

        public WSDTO convert​(DATA source,
                             java.lang.String fields)
        Description copied from interface: DataToWsConverter
        Method to convert a source object to a target object.
        Specified by:
        convert in interface DataToWsConverter<DATA,​WSDTO>
        Parameters:
        source - the source object
        fields - the fields that should be populated in target object
        Returns:
        the target object
      • convertMap

        public java.util.Map<java.lang.String,​java.lang.Object> convertMap​(java.util.Map<java.lang.String,​java.lang.Object> map)
        Convert a map that contains data objects to a map that contains ws objects.
        Parameters:
        map - the map that contains data objects
        Returns:
        the map that contains ws objects.
      • convertPrimitive

        public java.lang.Object convertPrimitive​(java.lang.Object source)
        Converts primitives from source to target
        Parameters:
        source - the source primitive
        Returns:
        the target primitive
      • convertCollection

        public java.util.Collection<java.lang.Object> convertCollection​(java.util.Collection<java.lang.Object> source)
        Converts collection that contains data objects to a collection that contains ws objects.
        Parameters:
        source - the collection that contains data objects
        Returns:
        the collection that contains ws objects.
      • customize

        public void customize​(ma.glasnost.orika.MapperFactory factory)
        Description copied from interface: DataToWsConverter
        Method to customize conversion between source and target object. This method is called after the basic conversion is finished.
        Specified by:
        customize in interface DataToWsConverter<DATA,​WSDTO>
        Parameters:
        factory - the MapperFactory that can be used to add new customization.
      • isCollection

        protected static boolean isCollection​(java.lang.Object valueObj)
        Method tests whether the Object is a Collection.
        Parameters:
        valueObj - the Object to test
        Returns:
        true if the Object is a Collection, false otherwise.
      • isMap

        protected static boolean isMap​(java.lang.Object valueObj)
        Method tests whether the Object is a Map.
        Parameters:
        valueObj - the Object to test
        Returns:
        true if the Object is a Map, false otherwise.