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

org.faktorips.runtime.DeltaComputationOptionsByPosition Maven / Gradle / Ivy

/*******************************************************************************
 * Copyright (c) Faktor Zehn GmbH - faktorzehn.org
 * 
 * This source code is available under the terms of the AGPL Affero General Public License version
 * 3.
 * 
 * Please see LICENSE.txt for full license terms, including the additional permissions and
 * restrictions as well as the possibility of alternative license terms.
 *******************************************************************************/

package org.faktorips.runtime;

import java.util.Objects;

/**
 * Delta computation options that create child deltas per position and don't ignore any property.
 * 
 * @see IDeltaComputationOptions.ComputationMethod#BY_POSITION
 * 
 * @author Jan Ortmann
 */
public class DeltaComputationOptionsByPosition implements IDeltaComputationOptions {

    @Override
    public ComputationMethod getMethod(String association) {
        return ComputationMethod.BY_POSITION;
    }

    /**
     * Returns true if the specified object references are identical.
     */
    @Override
    public boolean isSame(IModelObject object1, IModelObject object2) {
        return object1 == object2;
    }

    /**
     * Returns false.
     */
    @Override
    public boolean ignore(Class clazz, String property) {
        return false;
    }

    @Override
    public boolean isCreateSubtreeDelta() {
        return false;
    }

    @Override
    public boolean areValuesEqual(Class modelClass, String property, Object value1, Object value2) {
        return Objects.equals(value1, value2);
    }

    @Override
    public boolean ignoreAssociations() {
        return false;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy