24 package org.lightjason.agentspeak.action.builtin.datetime;
26 import com.codepoetics.protonpack.StreamUtils;
35 import javax.annotation.Nonnegative;
36 import javax.annotation.Nonnull;
37 import java.time.ZoneId;
38 import java.time.ZonedDateTime;
39 import java.util.List;
68 @Nonnull
final List<ITerm> p_argument, @Nonnull
final List<ITerm> p_return )
77 .forEach( p_return::add );
89 private static ZonedDateTime
apply( @Nonnull
final List<ITerm> p_elements )
91 return ZonedDateTime.of(
94 p_elements.get( 0 ).<Number>raw().intValue(),
95 p_elements.get( 1 ).<Number>raw().intValue(),
96 p_elements.get( 2 ).<Number>raw().intValue(),
99 p_elements.get( 3 ).<Number>raw().intValue(),
100 p_elements.get( 4 ).<Number>raw().intValue(),
101 p_elements.get( 5 ).<Number>raw().intValue(),
102 p_elements.get( 6 ).<Number>raw().intValue(),
105 (
"current".equalsIgnoreCase( p_elements.get( 7 ).<String>raw().trim() ) ) || ( p_elements.get( 7 ).<String>raw().trim().isEmpty() )
106 ? ZoneId.systemDefault()
107 : ZoneId.of( p_elements.get( 7 ).<String>raw().trim() )
static final long serialVersionUID
serial id
base class of build-in actions for setting name by package/classname (without prefix character) ...
final int minimalArgumentNumber()
minimum number of arguments
builds a date-time object from elements.
static< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
static ZonedDateTime apply( @Nonnull final List< ITerm > p_elements)
creates the date-time object
common structure for execution definition
execution context with local data
static Stream< ITerm > flatten( @Nonnull final Collection<? extends ITerm > p_terms)
flat term-in-term collection into a straight term list
result for an immutable fuzzy value
static< N > CRawTerm< N > from(final N p_value)
factory for a raw term
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
term structure for simple datatypes