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

fr.pacifista.api.server.warps.service.mappers.WarpMapperImpl Maven / Gradle / Ivy

There is a newer version: 1.5.3.11
Show newest version
package fr.pacifista.api.server.warps.service.mappers;

import fr.pacifista.api.server.warps.client.dtos.WarpDTO;
import fr.pacifista.api.server.warps.service.entities.Warp;
import javax.annotation.processing.Generated;
import org.springframework.stereotype.Component;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-03-13T12:56:43+0000",
    comments = "version: 1.5.5.Final, compiler: javac, environment: Java 17.0.10 (Eclipse Adoptium)"
)
@Component
public class WarpMapperImpl implements WarpMapper {

    @Override
    public Warp toEntity(WarpDTO dto) {
        if ( dto == null ) {
            return null;
        }

        Warp warp = new Warp();

        warp.setUuid( dto.getId() );
        warp.setCreatedAt( dto.getCreatedAt() );
        warp.setUpdatedAt( dto.getUpdatedAt() );
        warp.setWorldUuid( dto.getWorldUuid() );
        warp.setServerType( dto.getServerType() );
        warp.setX( dto.getX() );
        warp.setY( dto.getY() );
        warp.setZ( dto.getZ() );
        warp.setYaw( dto.getYaw() );
        warp.setPitch( dto.getPitch() );
        warp.setPlayerOwnerUuid( dto.getPlayerOwnerUuid() );
        warp.setName( dto.getName() );
        warp.setWarpItem( dto.getWarpItem() );
        warp.setPublicAccess( dto.getPublicAccess() );
        warp.setType( dto.getType() );

        return warp;
    }

    @Override
    public WarpDTO toDto(Warp entity) {
        if ( entity == null ) {
            return null;
        }

        WarpDTO warpDTO = new WarpDTO();

        warpDTO.setId( entity.getUuid() );
        warpDTO.setCreatedAt( entity.getCreatedAt() );
        warpDTO.setUpdatedAt( entity.getUpdatedAt() );
        warpDTO.setWorldUuid( entity.getWorldUuid() );
        warpDTO.setServerType( entity.getServerType() );
        warpDTO.setX( entity.getX() );
        warpDTO.setY( entity.getY() );
        warpDTO.setZ( entity.getZ() );
        warpDTO.setYaw( entity.getYaw() );
        warpDTO.setPitch( entity.getPitch() );
        warpDTO.setName( entity.getName() );
        warpDTO.setWarpItem( entity.getWarpItem() );
        warpDTO.setPublicAccess( entity.getPublicAccess() );
        warpDTO.setPlayerOwnerUuid( entity.getPlayerOwnerUuid() );
        warpDTO.setType( entity.getType() );

        return warpDTO;
    }

    @Override
    public void patch(Warp request, Warp toPatch) {
        if ( request == null ) {
            return;
        }

        if ( request.getUuid() != null ) {
            toPatch.setUuid( request.getUuid() );
        }
        if ( request.getId() != null ) {
            toPatch.setId( request.getId() );
        }
        if ( request.getCreatedAt() != null ) {
            toPatch.setCreatedAt( request.getCreatedAt() );
        }
        if ( request.getUpdatedAt() != null ) {
            toPatch.setUpdatedAt( request.getUpdatedAt() );
        }
        if ( request.getWorldUuid() != null ) {
            toPatch.setWorldUuid( request.getWorldUuid() );
        }
        if ( request.getServerType() != null ) {
            toPatch.setServerType( request.getServerType() );
        }
        if ( request.getX() != null ) {
            toPatch.setX( request.getX() );
        }
        if ( request.getY() != null ) {
            toPatch.setY( request.getY() );
        }
        if ( request.getZ() != null ) {
            toPatch.setZ( request.getZ() );
        }
        if ( request.getYaw() != null ) {
            toPatch.setYaw( request.getYaw() );
        }
        if ( request.getPitch() != null ) {
            toPatch.setPitch( request.getPitch() );
        }
        if ( request.getPlayerOwnerUuid() != null ) {
            toPatch.setPlayerOwnerUuid( request.getPlayerOwnerUuid() );
        }
        if ( request.getName() != null ) {
            toPatch.setName( request.getName() );
        }
        if ( request.getWarpItem() != null ) {
            toPatch.setWarpItem( request.getWarpItem() );
        }
        if ( request.getPublicAccess() != null ) {
            toPatch.setPublicAccess( request.getPublicAccess() );
        }
        if ( request.getType() != null ) {
            toPatch.setType( request.getType() );
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy