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

com.eurodyn.qlack.fuse.cm.mapper.NodeAttributeMapperImpl Maven / Gradle / Ivy

There is a newer version: 3.6.8
Show newest version
package com.eurodyn.qlack.fuse.cm.mapper;

import com.eurodyn.qlack.fuse.cm.dto.NodeAttributeDTO;
import com.eurodyn.qlack.fuse.cm.model.NodeAttribute;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
import org.springframework.stereotype.Component;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2019-11-22T14:00:22+0000",
    comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_222 (Private Build)"
)
@Component
public class NodeAttributeMapperImpl implements NodeAttributeMapper {

    @Override
    public List mapToDTO(List entity) {
        if ( entity == null ) {
            return null;
        }

        List list = new ArrayList( entity.size() );
        for ( NodeAttribute nodeAttribute : entity ) {
            list.add( mapToDTO( nodeAttribute ) );
        }

        return list;
    }

    @Override
    public NodeAttribute mapToEntity(NodeAttributeDTO dto) {
        if ( dto == null ) {
            return null;
        }

        NodeAttribute nodeAttribute = new NodeAttribute();

        nodeAttribute.setName( dto.getName() );
        nodeAttribute.setValue( dto.getValue() );

        return nodeAttribute;
    }

    @Override
    public List mapToEntity(List dto) {
        if ( dto == null ) {
            return null;
        }

        List list = new ArrayList( dto.size() );
        for ( NodeAttributeDTO nodeAttributeDTO : dto ) {
            list.add( mapToEntity( nodeAttributeDTO ) );
        }

        return list;
    }

    @Override
    public NodeAttributeDTO mapToDTO(NodeAttribute nodeAttribute) {
        if ( nodeAttribute == null ) {
            return null;
        }

        NodeAttributeDTO nodeAttributeDTO = new NodeAttributeDTO();

        nodeAttributeDTO.setNodeId( mapNode( nodeAttribute.getNode() ) );
        nodeAttributeDTO.setName( nodeAttribute.getName() );
        nodeAttributeDTO.setValue( nodeAttribute.getValue() );

        return nodeAttributeDTO;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy