Package org.modelmapper
Class Converters.Collection
- java.lang.Object
-
- org.modelmapper.Converters.Collection
-
- Enclosing class:
- Converters
public static class Converters.Collection extends Object
Provides helper methods to create converters for collection.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <S> Converters.ChainableConverter<Collection<S>,S>
first()
Provides a helper method to create a collection converter that will get the first element of source collect and convert it.static <S,D>
Converter<Collection<S>,Collection<D>>map(Converters.Converter<S,D> elementConverter)
Provides a helper method to create a collection converter that will map each element based on theelementConverter
.
-
-
-
Method Detail
-
map
public static <S,D> Converter<Collection<S>,Collection<D>> map(Converters.Converter<S,D> elementConverter)
Provides a helper method to create a collection converter that will map each element based on theelementConverter
.using(Collection.map(String::toUpperCase)).map(); using(Collection.map(ele -> new Destination(ele)).map();
- Type Parameters:
S
- the source element typeD
- the destination element type- Parameters:
elementConverter
- the converter to map the source element to destination element- Returns:
- a Converter
-
first
public static <S> Converters.ChainableConverter<Collection<S>,S> first()
Provides a helper method to create a collection converter that will get the first element of source collect and convert it.using(Collection.first().to(Destination.class).map();
- Type Parameters:
S
- the source type- Returns:
- a
ChainableConverter
-
-