mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#58 Adding methods in test mapper
This commit is contained in:
parent
764f5040da
commit
305a2ec475
@ -63,17 +63,21 @@ public class Type extends AbstractModelElement implements Comparable<Type> {
|
||||
new ConcurrentHashMap<String, Type>();
|
||||
|
||||
static {
|
||||
//base
|
||||
DEFAULT_ITERABLE_IMPLEMENTATION_TYPES.put( Iterable.class.getName(), forClass( ArrayList.class ) );
|
||||
DEFAULT_COLLECTION_IMPLEMENTATION_TYPES.put( Collection.class.getName(), forClass( ArrayList.class ) );
|
||||
|
||||
//list
|
||||
DEFAULT_COLLECTION_IMPLEMENTATION_TYPES.put( List.class.getName(), forClass( ArrayList.class ) );
|
||||
|
||||
//set
|
||||
DEFAULT_COLLECTION_IMPLEMENTATION_TYPES.put( Set.class.getName(), forClass( HashSet.class ) );
|
||||
DEFAULT_COLLECTION_IMPLEMENTATION_TYPES.put( SortedSet.class.getName(), forClass( TreeSet.class ) );
|
||||
DEFAULT_COLLECTION_IMPLEMENTATION_TYPES.put( NavigableSet.class.getName(), forClass( TreeSet.class ) );
|
||||
|
||||
DEFAULT_ITERABLE_IMPLEMENTATION_TYPES.putAll( DEFAULT_COLLECTION_IMPLEMENTATION_TYPES );
|
||||
|
||||
//map
|
||||
DEFAULT_MAP_IMPLEMENTATION_TYPES.put( Map.class.getName(), forClass( HashMap.class ) );
|
||||
DEFAULT_MAP_IMPLEMENTATION_TYPES.put( SortedMap.class.getName(), forClass( TreeMap.class ) );
|
||||
DEFAULT_MAP_IMPLEMENTATION_TYPES.put( NavigableMap.class.getName(), forClass( TreeMap.class ) );
|
||||
|
@ -20,7 +20,14 @@ package org.mapstruct.ap.test.collection.defaultimplementation;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.NavigableMap;
|
||||
import java.util.NavigableSet;
|
||||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
import java.util.SortedSet;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.ConcurrentNavigableMap;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mappers;
|
||||
@ -48,4 +55,18 @@ public interface SourceTargetMapper {
|
||||
|
||||
Iterable<TargetFoo> sourceFoosToTargetFoosUsingTargetParameterAndReturn(Iterable<SourceFoo> sourceFoos,
|
||||
@MappingTarget List<TargetFoo> targetFoos);
|
||||
|
||||
SortedSet<TargetFoo> sourceFoosToTargetFooSortedSet(Collection<SourceFoo> foos);
|
||||
|
||||
NavigableSet<TargetFoo> sourceFoosToTargetFooNavigableSet(Collection<SourceFoo> foos);
|
||||
|
||||
Map<String, TargetFoo> sourceFooMapToTargetFooMap(Map<Long, SourceFoo> foos);
|
||||
|
||||
SortedMap<String, TargetFoo> sourceFooMapToTargetFooSortedMap(Map<Long, SourceFoo> foos);
|
||||
|
||||
NavigableMap<String, TargetFoo> sourceFooMapToTargetFooNavigableMap(Map<Long, SourceFoo> foos);
|
||||
|
||||
ConcurrentMap<String, TargetFoo> sourceFooMapToTargetFooConcurrentMap(Map<Long, SourceFoo> foos);
|
||||
|
||||
ConcurrentNavigableMap<String, TargetFoo> sourceFooMapToTargetFooConcurrentNavigableMap(Map<Long, SourceFoo> foos);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user