24 package org.lightjason.agentspeak.action.builtin.storage;
26 import com.codepoetics.protonpack.StreamUtils;
33 import javax.annotation.Nonnegative;
34 import javax.annotation.Nonnull;
35 import javax.annotation.Nullable;
36 import java.util.List;
37 import java.util.function.Function;
38 import java.util.stream.Stream;
68 public CAdd( @Nonnull
final Function<String, Boolean> p_resolver )
78 public CAdd( @Nullable
final String... p_forbidden )
88 public CAdd( @Nonnull
final Stream<String> p_fordbidden )
90 super( p_fordbidden );
103 @Nonnull
final List<ITerm> p_argument, @Nonnull
final List<ITerm> p_return
106 StreamUtils.windowed(
110 ).forEach( i -> this.
add( p_context.agent(), i.get( 0 ).<String>raw(), i.get( 1 ) ) );
122 private void add( @Nonnull
final IAgent<?> p_agent, @Nonnull
final String p_key, @Nonnull
final ITerm p_value )
127 p_agent.storage().put( p_key, p_value.raw() );
static final long serialVersionUID
serial id
CAdd( @Nonnull final Function< String, Boolean > p_resolver)
ctor
void add( @Nonnull final IAgent<?> p_agent, @Nonnull final String p_key, @Nonnull final ITerm p_value)
adds a value into the storage
static< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
final Function< String, Boolean > m_resolver
set with forbidden keys
CAdd( @Nonnull final Stream< String > p_fordbidden)
ctor
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
result for an immutable fuzzy value
storage default definitions
CAdd( @Nullable final String... p_forbidden)
ctor
final int minimalArgumentNumber()
minimum number of arguments
adds or overwrites an element in the agent-storage.