Interface Mapper<SOURCE,TARGET>

Type Parameters:
SOURCE - type of the supported source
TARGET - type of the supported target
All Superinterfaces:
Function<SOURCE,TARGET>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Mapper<SOURCE,TARGET> extends Function<SOURCE,TARGET>
A generic and general approach to mapping two types. A mapper is unidirectional - from SOURCE to TARGET.
  • Method Summary

    Modifier and Type
    Method
    Description
    default TARGET
    apply(SOURCE source)
     
    map(SOURCE source)
    Map an instance of source type to an instance of target type.

    Methods inherited from interface java.util.function.Function

    andThen, compose
  • Method Details

    • map

      TARGET map(SOURCE source)
      Map an instance of source type to an instance of target type.
      Parameters:
      source - object to map
      Returns:
      result of the mapping
    • apply

      default TARGET apply(SOURCE source)
      Specified by:
      apply in interface Function<SOURCE,TARGET>