24 package org.lightjason.agentspeak.action.builtin.storage;
34 import javax.annotation.Nonnegative;
35 import javax.annotation.Nonnull;
36 import javax.annotation.Nullable;
37 import java.util.List;
38 import java.util.function.Function;
39 import java.util.stream.Stream;
70 public CRemove( @Nonnull
final Function<String, Boolean> p_resolver )
80 public CRemove( @Nullable
final String... p_forbidden )
90 public CRemove( @Nonnull
final Stream<String> p_fordbidden )
92 super( p_fordbidden );
105 @Nonnull
final List<ITerm> p_argument, @Nonnull
final List<ITerm> p_return )
108 .map(
ITerm::<String>raw )
109 .forEach( i -> this.
remove( p_context.agent(), i, p_return ) );
122 private void remove( @Nonnull
final IAgent<?> p_agent, @Nonnull
final String p_key, @Nonnull
final List<ITerm> p_return )
124 if ( (
m_resolver.apply( p_key ) ) || ( !p_agent.storage().containsKey( p_key ) ) )
129 p_agent.storage().remove( p_key )
static< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
common structure for execution definition
final Function< String, Boolean > m_resolver
set with forbidden keys
removes an element by name from the storage.
CRemove( @Nonnull final Stream< String > p_fordbidden)
ctor
final int minimalArgumentNumber()
minimum number of arguments
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
CRemove( @Nonnull final Function< String, Boolean > p_resolver)
ctor
result for an immutable fuzzy value
storage default definitions
CRemove( @Nullable final String... p_forbidden)
ctor
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 > CRawTerm< N > from(final N p_value)
factory for a raw term
term structure for simple datatypes
static final long serialVersionUID
serial id