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

net.sf.aguacate.function.spi.impl.FunctionGreaterThanToday Maven / Gradle / Ivy

There is a newer version: 0.10.9
Show newest version
package net.sf.aguacate.function.spi.impl;

import java.util.Collection;
import java.util.Date;

import net.sf.aguacate.function.FunctionContext;
import net.sf.aguacate.function.FunctionEvalResult;
import net.sf.aguacate.function.spi.AbstractFunction1;
import net.sf.aguacate.util.parameter.Parameter;

public class FunctionGreaterThanToday extends AbstractFunction1 {

	public FunctionGreaterThanToday(Collection methods, String name, String message, Parameter parameter) {
		super(methods, name, message, parameter);
	}

	@Override
	protected FunctionEvalResult evaluate(FunctionContext functionContext, String msg, Object value) {
		if (new Date().compareTo((Date) value) >= 0) {
			logFailure(msg);
			return new FunctionEvalResult("Less or equals than today", null);
		} else {
			logSuccess(msg);
			return new FunctionEvalResult(null, null);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy