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

org.seedstack.business.internal.migrate.LegacyAssemblerAdapter Maven / Gradle / Ivy

There is a newer version: 4.5.0
Show newest version
/*
 * Copyright © 2013-2018, The SeedStack authors 
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

package org.seedstack.business.internal.migrate;

import org.seedstack.business.assembler.Assembler;
import org.seedstack.business.assembler.LegacyAssembler;

class LegacyAssemblerAdapter implements LegacyAssembler {
    private final Assembler assembler;

    LegacyAssemblerAdapter(Assembler assembler) {
        this.assembler = assembler;
    }

    @Override
    public D createDtoFromAggregate(A sourceAggregate) {
        return assembler.createDtoFromAggregate(sourceAggregate);
    }

    @Override
    public void mergeAggregateIntoDto(A sourceAggregate, D targetDto) {
        assembler.mergeAggregateIntoDto(sourceAggregate, targetDto);
    }

    @Override
    public void mergeDtoIntoAggregate(D sourceDto, A targetAggregate) {
        assembler.mergeDtoIntoAggregate(sourceDto, targetAggregate);
    }

    @Override
    public D createDto() {
        return assembler.createDto();
    }

    @Override
    public Class getDtoClass() {
        return assembler.getDtoClass();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy