24 package org.lightjason.agentspeak.action.builtin.datetime;
34 import javax.annotation.Nonnull;
35 import java.time.ZonedDateTime;
36 import java.time.format.DateTimeParseException;
37 import java.util.List;
38 import java.util.stream.Stream;
60 @Nonnull
final List<ITerm> p_argument, @Nonnull
final List<ITerm> p_return
66 p_argument.size() == 0
82 protected abstract boolean elements( @Nonnull
final ZonedDateTime p_datetime, @Nonnull
final List<ITerm> p_return );
91 private boolean getdatetime( @Nonnull
final ITerm p_value, @Nonnull
final List<ITerm> p_return )
94 return this.
elements( p_value.<ZonedDateTime>raw(), p_return );
99 ( p_value.<String>raw().isEmpty() ) || (
"now".equalsIgnoreCase( p_value.<String>raw() ) )
100 ? ZonedDateTime.now()
101 : ZonedDateTime.parse( p_value.<String>raw() ),
105 catch (
final DateTimeParseException l_excaption )
base class of build-in actions for setting name by package/classname (without prefix character) ...
abstract boolean elements( @Nonnull final ZonedDateTime p_datetime, @Nonnull final List< ITerm > p_return)
transfers the date-time element to term elements
abstract class for date-time access
static< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
common structure for execution definition
execution context with local data
final IFuzzyValue< Boolean > execute(final boolean p_parallel, @Nonnull final IContext p_context, @Nonnull final List< ITerm > p_argument, @Nonnull final List< ITerm > p_return)
defines a plan-body operation
static Stream< ITerm > flatten( @Nonnull final Collection<? extends ITerm > p_terms)
flat term-in-term collection into a straight term list
boolean getdatetime( @Nonnull final ITerm p_value, @Nonnull final List< ITerm > p_return)
creates the date representation
static< T > boolean rawvalueAssignableTo( @Nonnull final T p_value, @Nonnull final Class<?>... p_class)
checks a term value for assignable class
result for an immutable fuzzy value
static< N > CRawTerm< N > from(final N p_value)
factory for a raw term
static final long serialVersionUID
serial id
term structure for simple datatypes