
net.sf.aguacate.function.spi.impl.FunctionRename Maven / Gradle / Ivy
package net.sf.aguacate.function.spi.impl;
import java.text.MessageFormat;
import java.util.Collection;
import net.sf.aguacate.function.FunctionEvalResult;
import net.sf.aguacate.function.Parameter;
import net.sf.aguacate.function.spi.AbstractFunction1;
public class FunctionRename extends AbstractFunction1 {
public FunctionRename(Collection methods, String name, String message, Parameter parameter,
String outputName) {
super(methods, name, message, parameter, outputName);
}
@Override
protected FunctionEvalResult evaluate(Object value) {
String msg = MessageFormat.format(getMessage(), value);
if (value == null) {
logFailure(msg);
return new FunctionEvalResult("Null value", null);
} else {
logSuccess(msg);
return new FunctionEvalResult(null, value);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy