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

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

There is a newer version: 0.6.5.5
Show newest version
package com.arextest.web.model.mapper;

import com.arextest.web.model.contract.contracts.filesystem.FSNodeType;
import com.arextest.web.model.dto.filesystem.AddressDto;
import com.arextest.web.model.dto.filesystem.FSInterfaceDto;
import com.arextest.web.model.dto.filesystem.FSItemDto;
import com.arextest.web.model.dto.filesystem.FSNodeDto;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-09-25T05:48:00+0000",
    comments = "version: 1.5.5.Final, compiler: javac, environment: Java 11.0.24 (Eclipse Adoptium)"
)
public class FSNodeMapperImpl implements FSNodeMapper {

    @Override
    public FSNodeDto copy(FSNodeDto dto) {
        if ( dto == null ) {
            return null;
        }

        FSNodeDto fSNodeDto = new FSNodeDto();

        fSNodeDto.setNodeName( dto.getNodeName() );
        fSNodeDto.setNodeType( dto.getNodeType() );
        fSNodeDto.setInfoId( dto.getInfoId() );
        fSNodeDto.setMethod( dto.getMethod() );
        fSNodeDto.setCaseSourceType( dto.getCaseSourceType() );
        Set set = dto.getLabelIds();
        if ( set != null ) {
            fSNodeDto.setLabelIds( new LinkedHashSet( set ) );
        }
        List list = dto.getChildren();
        if ( list != null ) {
            fSNodeDto.setChildren( new ArrayList( list ) );
        }
        fSNodeDto.setExistChildren( dto.getExistChildren() );

        return fSNodeDto;
    }

    @Override
    public FSNodeType contractFromDto(FSNodeDto dto) {
        if ( dto == null ) {
            return null;
        }

        FSNodeType fSNodeType = new FSNodeType();

        fSNodeType.setNodeName( dto.getNodeName() );
        fSNodeType.setNodeType( dto.getNodeType() );
        fSNodeType.setInfoId( dto.getInfoId() );
        fSNodeType.setMethod( dto.getMethod() );
        fSNodeType.setCaseSourceType( dto.getCaseSourceType() );
        Set set = dto.getLabelIds();
        if ( set != null ) {
            fSNodeType.setLabelIds( new LinkedHashSet( set ) );
        }
        fSNodeType.setChildren( fSNodeDtoListToFSNodeTypeList( dto.getChildren() ) );
        fSNodeType.setExistChildren( dto.getExistChildren() );

        return fSNodeType;
    }

    @Override
    public FSNodeType contractFromFSItemDto(FSItemDto dto) {
        if ( dto == null ) {
            return null;
        }

        FSNodeType fSNodeType = new FSNodeType();

        fSNodeType.setInfoId( dto.getId() );
        fSNodeType.setNodeName( dto.getName() );
        Set set = dto.getLabelIds();
        if ( set != null ) {
            fSNodeType.setLabelIds( new LinkedHashSet( set ) );
        }

        return fSNodeType;
    }

    @Override
    public FSNodeType contractFromFSInterfaceDto(FSInterfaceDto dto) {
        if ( dto == null ) {
            return null;
        }

        FSNodeType fSNodeType = new FSNodeType();

        fSNodeType.setInfoId( dto.getId() );
        fSNodeType.setNodeName( dto.getName() );
        fSNodeType.setMethod( dtoAddressMethod( dto ) );
        Set set = dto.getLabelIds();
        if ( set != null ) {
            fSNodeType.setLabelIds( new LinkedHashSet( set ) );
        }

        return fSNodeType;
    }

    protected List fSNodeDtoListToFSNodeTypeList(List list) {
        if ( list == null ) {
            return null;
        }

        List list1 = new ArrayList( list.size() );
        for ( FSNodeDto fSNodeDto : list ) {
            list1.add( contractFromDto( fSNodeDto ) );
        }

        return list1;
    }

    private String dtoAddressMethod(FSInterfaceDto fSInterfaceDto) {
        if ( fSInterfaceDto == null ) {
            return null;
        }
        AddressDto address = fSInterfaceDto.getAddress();
        if ( address == null ) {
            return null;
        }
        String method = address.getMethod();
        if ( method == null ) {
            return null;
        }
        return method;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy