本文整理了Java中org.modelmapper.ModelMapper.createTypeMap()
方法的一些代码示例,展示了ModelMapper.createTypeMap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ModelMapper.createTypeMap()
方法的具体详情如下:
包路径:org.modelmapper.ModelMapper
类名称:ModelMapper
方法名:createTypeMap
[英]Creates a TypeMap for the sourceType and destinationType using the ModelMapper's configuration.
[中]使用ModelMapper的配置为sourceType和destinationType创建类型映射。
代码示例来源:origin: bramp/ffmpeg-cli-wrapper
private static <S, D> TypeMap<S, D> createTypeMap(
ModelMapper mapper, Class<S> sourceType, Class<D> destinationType, Configuration config) {
return mapper
.createTypeMap(sourceType, destinationType, config)
// We setPropertyCondition because ModelMapper seems to ignore this in
// the config
.setPropertyCondition(config.getPropertyCondition());
}
代码示例来源:origin: org.modelmapper/modelmapper
/**
* Creates a TypeMap for the {@code source}'s type and {@code destinationType} using the
* ModelMapper's configuration. Useful for creating TypeMaps for generic source data structures.
*
* @param <S> source type
* @param <D> destination type
* @param source
* @param destinationType
* @throws IllegalArgumentException if {@code source} or {@code destinationType} are null
* @throws IllegalStateException if a TypeMap already exists for {@code source}'s type and
* {@code destinationType}
* @throws ConfigurationException if the ModelMapper cannot create the TypeMap
* @see #getTypeMap(Class, Class)
*/
public <S, D> TypeMap<S, D> createTypeMap(S source, Class<D> destinationType) {
return this.<S, D>createTypeMap(source, destinationType, config);
}
代码示例来源:origin: org.modelmapper/modelmapper
/**
* Creates a TypeMap for the {@code sourceType} and {@code destinationType} using the
* ModelMapper's configuration.
*
* @param <S> source type
* @param <D> destination type
* @param sourceType
* @param destinationType
* @throws IllegalArgumentException if {@code sourceType} or {@code destinationType} are null
* @throws IllegalStateException if a TypeMap already exists for {@code sourceType} and
* {@code destinationType}
* @throws ConfigurationException if the ModelMapper cannot create the TypeMap
* @see #getTypeMap(Class, Class)
*/
public <S, D> TypeMap<S, D> createTypeMap(Class<S> sourceType, Class<D> destinationType) {
return this.<S, D>createTypeMap(sourceType, destinationType, config);
}
代码示例来源:origin: org.modelmapper/modelmapper
/**
* Creates a TypeMap for the {@code source}'s type and {@code destinationType} identified by the
* {@code typeMapName} using the ModelMapper's configuration. Useful for creating TypeMaps for
* generic source data structures.
*
* @param <S> source type
* @param <D> destination type
* @param source
* @param destinationType
* @param typeMapName
* @throws IllegalArgumentException if {@code source}, {@code destinationType} or
* {@code typeMapName} are null
* @throws IllegalStateException if a TypeMap already exists for {@code source}'s type,
* {@code destinationType} and {@code typeMapName}
* @throws ConfigurationException if the ModelMapper cannot create the TypeMap
* @see #getTypeMap(Class, Class, String)
*/
public <S, D> TypeMap<S, D> createTypeMap(S source, Class<D> destinationType, String typeMapName) {
return this.<S, D>createTypeMap(source, destinationType, typeMapName, config);
}
代码示例来源:origin: org.modelmapper/modelmapper
/**
* Creates a TypeMap for the {@code sourceType} and {@code destinationType} identified by the
* {@code typeMapName} using the ModelMapper's configuration.
*
* @param <S> source type
* @param <D> destination type
* @param sourceType
* @param destinationType
* @param typeMapName
* @throws IllegalArgumentException if {@code sourceType}, {@code destinationType} or
* {@code typeMapName} are null
* @throws IllegalStateException if a TypeMap already exists for {@code sourceType},
* {@code destinationType} and {@code typeMapName}
* @throws ConfigurationException if the ModelMapper cannot create the TypeMap
* @see #getTypeMap(Class, Class, String)
*/
public <S, D> TypeMap<S, D> createTypeMap(Class<S> sourceType, Class<D> destinationType,
String typeMapName) {
return this.<S, D>createTypeMap(sourceType, destinationType, typeMapName, config);
}
代码示例来源:origin: stackoverflow.com
ModelMapper modelMapper = new ModelMapper();
List<Mapping> mappings = modelMapper.createTypeMap(Source.class, Dest.class).getMappings();
代码示例来源:origin: stackoverflow.com
ModelMapper modelMapper = new ModelMapper();
List<Mappings> mappings = modelMapper.createTypeMap(A.class, B.class).getMappings();
代码示例来源:origin: stackoverflow.com
mapper.createTypeMap(RecipeBO.class, Recipe.class).setConverter(converter);
代码示例来源:origin: stackoverflow.com
this.map().setId(this.source.getId());
this.map().setName(this.source.getName());
mapper.createTypeMap(TypeEnum.class, TypeClass.class).setConverter(
new Converter<TypeEnum, TypeClass>() {
@Override
内容来源于网络,如有侵权,请联系作者删除!