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

com.chutneytesting.admin.api.dto.BackupMapper Maven / Gradle / Ivy

The newest version!
/*
 * SPDX-FileCopyrightText: 2017-2024 Enedis
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 */

package com.chutneytesting.admin.api.dto;

import com.chutneytesting.admin.domain.Backup;
import java.util.List;
import java.util.stream.Collectors;

public class BackupMapper {

    public static Backup fromDto(BackupDto dto) {
        return new Backup(dto.getBackupables());
    }

    public static BackupDto toDto(Backup backup) {
        return new BackupDto(backup.time, backup.backupables);
    }

    public static List toDtos(List backups) {
        return backups.stream()
            .map(BackupMapper::toDto)
            .collect(Collectors.toList());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy