org.faktorips.runtime.DeltaComputationOptionsByPosition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of faktorips-runtime Show documentation
Show all versions of faktorips-runtime Show documentation
Runtime library for Faktor-IPS.
When using the JAXB support use either faktorips-runtime-jakarta-xml or faktorips-runtime-javax-xml as dependency.
When using CSV to read tables, add the optional dependencies to opencsv, commons-lang3 and commons-text.
If you want to run Faktor-IPS tests as JUnit tests, you need to provide either junit (JUnit 4) or junit-jupiter-api (JUnit 5).
/*******************************************************************************
* 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;
}
}