Search in sources :

Example 66 with ModelMapper

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;
}
Also used : ModelMapper(org.modelmapper.ModelMapper)

Example 67 with ModelMapper

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;
}
Also used : CatalogTool(it.istat.mec.catalog.domain.CatalogTool) DesktopApplication(it.istat.mec.catalog.domain.DesktopApplication) CatalogToolDTO(it.istat.mec.catalog.dto.CatalogToolDTO) StatisticalServiceDto(it.istat.mec.catalog.dto.StatisticalServiceDto) SoftwareProcedureDto(it.istat.mec.catalog.dto.SoftwareProcedureDto) DesktopApplicationDto(it.istat.mec.catalog.dto.DesktopApplicationDto) StatisticalService(it.istat.mec.catalog.domain.StatisticalService) SoftwareProcedure(it.istat.mec.catalog.domain.SoftwareProcedure) ModelMapper(org.modelmapper.ModelMapper)

Example 68 with ModelMapper

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;
}
Also used : Documentation(it.istat.mec.catalog.domain.Documentation) ModelMapper(org.modelmapper.ModelMapper)

Example 69 with ModelMapper

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;
}
Also used : AgentDto(it.istat.mec.catalog.dto.AgentDto) ModelMapper(org.modelmapper.ModelMapper)

Example 70 with ModelMapper

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;
}
Also used : DocumentationDto(it.istat.mec.catalog.dto.DocumentationDto) ModelMapper(org.modelmapper.ModelMapper)

Aggregations

ModelMapper (org.modelmapper.ModelMapper)194 Bean (org.springframework.context.annotation.Bean)31 ArrayList (java.util.ArrayList)19 Date (java.util.Date)8 Map (java.util.Map)5 Optional (java.util.Optional)5 Test (org.junit.jupiter.api.Test)5 Actor (com.management.entities.Actor)4 CinemaTheatre (com.management.entities.CinemaTheatre)4 Event (com.management.entities.Event)4 Performance (com.management.entities.Performance)4 Props (com.management.entities.Props)4 User (com.management.entities.User)4 IOException (java.io.IOException)4 List (java.util.List)4 PutMessageRequestType (no.difi.meldingsutveksling.noarkexchange.schema.PutMessageRequestType)4 Autowired (org.springframework.beans.factory.annotation.Autowired)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 Actorperformances (com.management.entities.Actorperformances)3 FanZone (com.management.entities.FanZone)3