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

org.seedstack.business.assembler.LegacyBaseTupleAssembler 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.assembler;

import org.javatuples.Tuple;

@Deprecated
public abstract class LegacyBaseTupleAssembler extends BaseTupleAssembler
        implements LegacyAssembler {
    @Override
    public D assembleDtoFromAggregate(T sourceAggregate) {
        D newDto = createDto();
        doAssembleDtoFromAggregate(newDto, sourceAggregate);
        return newDto;
    }

    protected abstract void doAssembleDtoFromAggregate(D targetDto, T sourceAggregate);

    protected abstract void doMergeAggregateWithDto(T targetAggregate, D sourceDto);

    @Override
    public void mergeAggregateIntoDto(T sourceAggregate, D targetDto) {
        doAssembleDtoFromAggregate(targetDto, sourceAggregate);
    }

    @Override
    public void mergeDtoIntoAggregate(D sourceDto, T targetAggregate) {
        doMergeAggregateWithDto(targetAggregate, sourceDto);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy