javafixes.object.changing.function.replacement.ReplaceNonEqualOldValueRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javafixes Show documentation
Show all versions of javafixes Show documentation
Things I would like to have in Java by default
package javafixes.object.changing.function.replacement;
import javafixes.object.changing.FailableValue;
import java.util.Objects;
public class ReplaceNonEqualOldValueRule implements ValueReplacementRule {
public static ReplaceNonEqualOldValueRule INSTANCE = new ReplaceNonEqualOldValueRule<>();
@Override
public boolean shouldReplaceOldValue(FailableValue extends T> oldValue, FailableValue extends T> newValue) {
return !Objects.equals(oldValue, newValue);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy