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

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

package com.arextest.web.model.mapper;

import com.arextest.web.model.contract.contracts.filesystem.FSQueryFolderResponseType;
import com.arextest.web.model.contract.contracts.filesystem.FSSaveFolderRequestType;
import com.arextest.web.model.dao.mongodb.FSFolderCollection;
import com.arextest.web.model.dto.filesystem.FSFolderDto;
import com.arextest.web.model.dto.filesystem.importexport.FolderItemDto;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;

/*
@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 FSFolderMapperImpl implements FSFolderMapper {

    @Override
    public FSFolderDto dtoFromContract(FSSaveFolderRequestType contract) {
        if ( contract == null ) {
            return null;
        }

        FSFolderDto fSFolderDto = new FSFolderDto();

        fSFolderDto.setId( contract.getId() );
        fSFolderDto.setWorkspaceId( contract.getWorkspaceId() );
        Map map = contract.getCustomTags();
        if ( map != null ) {
            fSFolderDto.setCustomTags( new LinkedHashMap( map ) );
        }

        return fSFolderDto;
    }

    @Override
    public FSQueryFolderResponseType contractFromDto(FSFolderDto dto) {
        if ( dto == null ) {
            return null;
        }

        FSQueryFolderResponseType fSQueryFolderResponseType = new FSQueryFolderResponseType();

        fSQueryFolderResponseType.setId( dto.getId() );
        fSQueryFolderResponseType.setName( dto.getName() );
        Map map = dto.getCustomTags();
        if ( map != null ) {
            fSQueryFolderResponseType.setCustomTags( new LinkedHashMap( map ) );
        }

        return fSQueryFolderResponseType;
    }

    @Override
    public FSFolderDto dtoFromDao(FSFolderCollection dao) {
        if ( dao == null ) {
            return null;
        }

        FSFolderDto fSFolderDto = new FSFolderDto();

        fSFolderDto.setId( dao.getId() );
        fSFolderDto.setName( dao.getName() );
        fSFolderDto.setWorkspaceId( dao.getWorkspaceId() );
        fSFolderDto.setParentId( dao.getParentId() );
        fSFolderDto.setParentNodeType( dao.getParentNodeType() );
        Map map = dao.getCustomTags();
        if ( map != null ) {
            fSFolderDto.setCustomTags( new LinkedHashMap( map ) );
        }

        return fSFolderDto;
    }

    @Override
    public FSFolderCollection daoFromDto(FSFolderDto dto) {
        if ( dto == null ) {
            return null;
        }

        FSFolderCollection fSFolderCollection = new FSFolderCollection();

        fSFolderCollection.setId( dto.getId() );
        fSFolderCollection.setName( dto.getName() );
        fSFolderCollection.setWorkspaceId( dto.getWorkspaceId() );
        fSFolderCollection.setParentId( dto.getParentId() );
        fSFolderCollection.setParentNodeType( dto.getParentNodeType() );
        Map map = dto.getCustomTags();
        if ( map != null ) {
            fSFolderCollection.setCustomTags( new LinkedHashMap( map ) );
        }

        return fSFolderCollection;
    }

    @Override
    public FolderItemDto ieItemFromFsItemDto(FSFolderDto dto) {
        if ( dto == null ) {
            return null;
        }

        FolderItemDto folderItemDto = new FolderItemDto();

        folderItemDto.setName( dto.getName() );
        Set set = dto.getLabelIds();
        if ( set != null ) {
            folderItemDto.setLabelIds( new LinkedHashSet( set ) );
        }

        return folderItemDto;
    }

    @Override
    public FSFolderDto fsItemFromIeItemDto(FolderItemDto dto) {
        if ( dto == null ) {
            return null;
        }

        FSFolderDto fSFolderDto = new FSFolderDto();

        fSFolderDto.setName( dto.getName() );
        Set set = dto.getLabelIds();
        if ( set != null ) {
            fSFolderDto.setLabelIds( new LinkedHashSet( set ) );
        }

        return fSFolderDto;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy