net.sf.aguacate.function.spi.impl.FunctionEquals Maven / Gradle / Ivy
package net.sf.aguacate.function.spi.impl;
import java.util.Collection;
import net.sf.aguacate.function.FunctionEvalResult;
import net.sf.aguacate.function.spi.AbstractFunction2;
import net.sf.aguacate.util.parameter.Parameter;
public class FunctionEquals extends AbstractFunction2 {
public FunctionEquals(Collection methods, String name, String message, Parameter parameter1,
Parameter parameter2) {
super(methods, name, message, parameter1, parameter2);
}
@Override
protected FunctionEvalResult evaluate(String msg, Object value1, Object value2) {
if (value1.equals(value2)) {
logFailure(msg);
return new FunctionEvalResult(null, null);
} else {
logSuccess(msg);
return new FunctionEvalResult("Not Equals", null);
}
}
}