use of org.modelmapper.ModelMapper in project catalogo-strumenti by istat-methodology.
the class Translators method translateUpdate.
public static StatisticalService translateUpdate(CreateStatisticalServiceRequest x, StatisticalService ss) {
final ModelMapper modelMapper = new ModelMapper();
modelMapper.map(x, ss);
return ss;
}
use of org.modelmapper.ModelMapper in project catalogo-strumenti by istat-methodology.
the class Translators method translate.
public static CatalogToolDTO translate(CatalogTool x) {
final ModelMapper modelMapper = new ModelMapper();
TypeMap<CatalogTool, CatalogToolDTO> typeMap = modelMapper.createTypeMap(CatalogTool.class, CatalogToolDTO.class);
typeMap.include(DesktopApplication.class, CatalogToolDTO.class).include(StatisticalService.class, CatalogToolDTO.class).include(SoftwareProcedure.class, CatalogToolDTO.class);
modelMapper.typeMap(DesktopApplication.class, CatalogToolDTO.class).setProvider(new Provider<CatalogToolDTO>() {
public CatalogToolDTO get(ProvisionRequest<CatalogToolDTO> request) {
return new DesktopApplicationDto();
}
});
modelMapper.typeMap(StatisticalService.class, CatalogToolDTO.class).setProvider(new Provider<CatalogToolDTO>() {
public CatalogToolDTO get(ProvisionRequest<CatalogToolDTO> request) {
return new StatisticalServiceDto();
}
});
modelMapper.typeMap(SoftwareProcedure.class, CatalogToolDTO.class).setProvider(new Provider<CatalogToolDTO>() {
public CatalogToolDTO get(ProvisionRequest<CatalogToolDTO> request) {
return new SoftwareProcedureDto();
}
});
CatalogToolDTO dTO = null;
if (x instanceof StatisticalService)
dTO = modelMapper.map(x, StatisticalServiceDto.class);
if (x instanceof DesktopApplication)
dTO = modelMapper.map(x, DesktopApplicationDto.class);
if (x instanceof SoftwareProcedure)
dTO = modelMapper.map(x, SoftwareProcedureDto.class);
return dTO;
}
use of org.modelmapper.ModelMapper in project catalogo-strumenti by istat-methodology.
the class Translators method translate.
public static Documentation translate(CreateDocumentationRequest x) {
final ModelMapper modelMapper = new ModelMapper();
final Documentation doc = modelMapper.map(x, Documentation.class);
return doc;
}
use of org.modelmapper.ModelMapper in project catalogo-strumenti by istat-methodology.
the class Translators method translate.
public static AgentDto translate(Agent x) {
final ModelMapper modelMapper = new ModelMapper();
final AgentDto dTO = modelMapper.map(x, AgentDto.class);
return dTO;
}
use of org.modelmapper.ModelMapper in project catalogo-strumenti by istat-methodology.
the class Translators method translate.
/*public static DesktopApplicationDto translate(DesktopApplication x) {
final ModelMapper modelMapper = new ModelMapper();
final DesktopApplicationDto dsDto = modelMapper.map(x, DesktopApplicationDto.class);
return dsDto;
}
public static SoftwareProcedureDto translate(SoftwareProcedure x) {
final ModelMapper modelMapper = new ModelMapper();
final SoftwareProcedureDto sp = modelMapper.map(x, SoftwareProcedureDto.class);
return sp;
}
/*/
public static DocumentationDto translate(Documentation x) {
final ModelMapper modelMapper = new ModelMapper();
final DocumentationDto doc = modelMapper.map(x, DocumentationDto.class);
return doc;
}
Aggregations