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

io.continual.util.data.exprEval.SpecialFnsDataSource Maven / Gradle / Ivy

There is a newer version: 0.3.14
Show newest version
package io.continual.util.data.exprEval;

import java.util.UUID;

import io.continual.util.time.Clock;

public class SpecialFnsDataSource implements ExprDataSource
{
	@Override
	public Object eval ( String label )
	{
		if ( label.equals ( "now" ) || label.equals ( "nowMs" ) )
		{
			return Clock.now ();
		}
		else if ( label.equals ( "nowSec") )
		{
			return Clock.now () / 1000L;
		}
		else if ( label.equals ( "uuid") )
		{
			return UUID.randomUUID ().toString ();
		}
		return null;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy