Interface MapTransformer

    • Method Detail

      • transform

        <T,​K> Map<T,​K> transform​(Map<T,​K> sourceMap)
        Copies all properties from a map to a new one applying the transformation function and mappings defined.
        Type Parameters:
        T - the key object type in the source map
        K - the elem object type in the source map
        Parameters:
        sourceMap - the source map
        Returns:
        a copy of the source object into the destination object
        Throws:
        IllegalArgumentException - if any parameter is invalid
      • transform

        <T,​K> Map<T,​K> transform​(Map<T,​K> sourceMap,
                                             BeanTransformer beanTransformer)
        Copies all properties from a map to a new one applying the transformation function and mappings defined.
        Type Parameters:
        T - the key object type in the source map
        K - the elem object type in the source map
        Parameters:
        sourceMap - the source map
        beanTransformer - the bean transformer to use for the map elements transformation
        Returns:
        a copy of the source object into the destination object
        Throws:
        IllegalArgumentException - if any parameter is invalid
      • transform

        <T,​K,​R,​V> Map<R,​V> transform​(Map<T,​K> sourceMap,
                                                             Class<R> targetKeyType,
                                                             Class<V> targetElemType)
        Copies all properties from a map to a new one applying the transformation function and mappings defined.
        Type Parameters:
        T - the key object type in the source map
        K - the elem object type in the source map
        R - the key object type in the target map
        V - the elem object type in the target map
        Parameters:
        sourceMap - the source map
        targetKeyType - the key type in the target map
        targetElemType - the elem type in the target map
        Returns:
        a copy of the source object into the destination object
        Throws:
        IllegalArgumentException - if any parameter is invalid
      • transform

        <T,​K,​R,​V> Map<R,​V> transform​(Map<T,​K> sourceMap,
                                                             BeanTransformer beanTransformer,
                                                             Class<R> targetKeyType,
                                                             Class<V> targetElemType)
        Copies all properties from a map to a new one applying the transformation function and mappings defined.
        Type Parameters:
        T - the key object type in the source map
        K - the elem object type in the source map
        R - the key object type in the target map
        V - the elem object type in the target map
        Parameters:
        sourceMap - the source map
        beanTransformer - the bean transformer to use for the map elements transformation
        targetKeyType - the key type in the target map
        targetElemType - the elem type in the target map
        Returns:
        a copy of the source object into the destination object
        Throws:
        IllegalArgumentException - if any parameter is invalid
      • withKeyTransformer

        MapTransformer withKeyTransformer​(FieldTransformer... keyFieldTransformer)
        Initializes the transformer functions to apply on a Map key. The transformer function returns directly the field value.
        Parameters:
        keyFieldTransformer - the fields transformer function
        Returns:
        the Transformer instance
      • resetKeyTransformer

        void resetKeyTransformer()
        Removes all the configured key transformer.