All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.arextest.web.model.mapper.LabelMapperImpl Maven / Gradle / Ivy

package com.arextest.web.model.mapper;

import com.arextest.web.model.contract.contracts.label.LabelType;
import com.arextest.web.model.contract.contracts.label.SaveLabelRequestType;
import com.arextest.web.model.dao.mongodb.LabelCollection;
import com.arextest.web.model.dto.LabelDto;

/*
@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-12-23T06:09:22+0000",
    comments = "version: 1.5.5.Final, compiler: javac, environment: Java 21.0.5 (Eclipse Adoptium)"
)
*/
public class LabelMapperImpl implements LabelMapper {

    @Override
    public LabelCollection daoFromDto(LabelDto dto) {
        if ( dto == null ) {
            return null;
        }

        LabelCollection labelCollection = new LabelCollection();

        labelCollection.setId( dto.getId() );
        labelCollection.setDataChangeCreateTime( dto.getDataChangeCreateTime() );
        labelCollection.setDataChangeUpdateTime( dto.getDataChangeUpdateTime() );
        labelCollection.setLabelName( dto.getLabelName() );
        labelCollection.setColor( dto.getColor() );
        labelCollection.setWorkspaceId( dto.getWorkspaceId() );

        return labelCollection;
    }

    @Override
    public LabelDto dtoFromDao(LabelCollection dao) {
        if ( dao == null ) {
            return null;
        }

        LabelDto labelDto = new LabelDto();

        labelDto.setId( dao.getId() );
        labelDto.setDataChangeCreateTime( dao.getDataChangeCreateTime() );
        labelDto.setDataChangeUpdateTime( dao.getDataChangeUpdateTime() );
        labelDto.setLabelName( dao.getLabelName() );
        labelDto.setColor( dao.getColor() );
        labelDto.setWorkspaceId( dao.getWorkspaceId() );

        return labelDto;
    }

    @Override
    public LabelDto dtoFromContract(SaveLabelRequestType request) {
        if ( request == null ) {
            return null;
        }

        LabelDto labelDto = new LabelDto();

        labelDto.setId( request.getId() );
        labelDto.setLabelName( request.getLabelName() );
        labelDto.setColor( request.getColor() );
        labelDto.setWorkspaceId( request.getWorkspaceId() );

        return labelDto;
    }

    @Override
    public LabelType contractFromDto(LabelDto dto) {
        if ( dto == null ) {
            return null;
        }

        LabelType labelType = new LabelType();

        labelType.setId( dto.getId() );
        labelType.setLabelName( dto.getLabelName() );
        labelType.setColor( dto.getColor() );
        labelType.setWorkspaceId( dto.getWorkspaceId() );

        return labelType;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy