24 package org.lightjason.agentspeak.action.builtin.web.rest;
32 import javax.annotation.Nonnull;
33 import java.io.IOException;
34 import java.util.List;
66 @SuppressWarnings(
"unchecked" )
68 @Nonnull final List<
ITerm> p_argument, @Nonnull final List<
ITerm> p_return
74 p_argument.get( 0 ).<String>raw(),
78 if ( p_argument.size() == 2 )
80 .map( i ->
CLiteral.
from( p_argument.get( p_argument.size() - 1 ).<String>raw(),
flatterm( (Map<String, ?>) i ) ) )
81 .forEach( p_return::add );
85 p_argument.stream().skip( 1 ).map(
ITerm::<String>raw ),
87 .map( i ->
CLiteral.
from( p_argument.get( p_argument.size() - 1 ).<String>raw(),
flatterm( (Map<String, ?>) i ) ) )
93 catch (
final IOException l_exception )
static Stream< ITerm > flatterm( @Nullable final Object p_object)
converts an object into a term stream
action for calling a restful webservice with a JSON object list.
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< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
static final long serialVersionUID
serial id
static ITerm baseliteral( @Nonnull final Stream< String > p_functor, @Nonnull final Stream< ITerm > p_values)
creates a literal structure from a stream of string elements, the string stream will be build in a tr...
execution context with local data
result for an immutable fuzzy value
default generic literal class for agent beliefs a literal consists of a functor, an optional list of ...
static ILiteral from( @Nonnull final String p_functor, @Nullable final ITerm... p_values)
factory
base class to read data from the restful service
static< T > T json( @Nonnull final String p_url, @Nonnull final Class< T > p_class)
reads a json structure from an url