public class EffectorUtils
extends java.lang.Object
Constructor and Description |
---|
EffectorUtils() |
Modifier and Type | Method and Description |
---|---|
static Maybe<Effector<?>> |
findEffector(java.util.Collection<? extends Effector<?>> effectors,
java.lang.String effectorName)
matches effectors by name only (not parameters)
|
static Maybe<Effector<?>> |
findEffectorDeclared(Entity entity,
java.lang.String effectorName)
matches effectors by name only (not parameters), based on what is declared on the entity static type
|
static java.util.Map<java.lang.Object,java.lang.Object> |
getTaskFlagsForEffectorInvocation(Entity entity,
Effector<?> effector,
ConfigBag parameters)
returns a (mutable) map of the standard flags which should be placed on an effector
|
static java.lang.RuntimeException |
handleEffectorException(Entity entity,
Effector<?> effector,
java.lang.Throwable throwable) |
static <T> Task<T> |
invokeEffectorAsync(Entity entity,
Effector<T> eff,
java.util.Map<java.lang.String,?> parameters) |
static <T> T |
invokeMethodEffector(Entity entity,
Effector<T> eff,
java.util.Map<java.lang.String,?> args)
Invokes a method effector so that its progress is tracked.
|
static java.lang.Object[] |
oldPrepareArgsForEffector(Effector<?> eff,
java.lang.Object args)
Takes arguments, and returns an array of arguments suitable for use by the Effector
according to the ParameterTypes it exposes.
|
static java.lang.Object[] |
prepareArgsForEffector(Effector<?> eff,
java.util.Map<?,?> args)
Prepares arguments for an effector, taking a map, which should contain the arguments by
name, optionally omitting those which have defaults defined; performs type coercion on
the values.
|
static java.lang.Object[] |
prepareArgsForEffector(Effector<?> eff,
java.lang.Object args)
Deprecated.
since 0.10.0
|
static java.lang.Object[] |
prepareArgsForEffector(Effector<?> eff,
java.lang.Object[] args)
Prepares arguments for an effector, taking an array, which should contain the arguments in
order, optionally omitting those which have defaults defined.
|
static java.util.Map |
prepareArgsForEffectorAsMapFromArray(Effector<?> eff,
java.lang.Object[] args) |
public static java.lang.Object[] prepareArgsForEffector(Effector<?> eff, java.lang.Object[] args)
public static java.lang.Object[] prepareArgsForEffector(Effector<?> eff, java.util.Map<?,?> args)
@Deprecated public static java.lang.Object[] prepareArgsForEffector(Effector<?> eff, java.lang.Object args)
prepareArgsForEffector(Effector, Object[])
;
or a map (see prepareArgsForEffector(Effector, Map)
.public static java.util.Map prepareArgsForEffectorAsMapFromArray(Effector<?> eff, java.lang.Object[] args)
public static java.lang.Object[] oldPrepareArgsForEffector(Effector<?> eff, java.lang.Object args)
The args can be:
public static <T> T invokeMethodEffector(Entity entity, Effector<T> eff, java.util.Map<java.lang.String,?> args)
public static java.lang.RuntimeException handleEffectorException(Entity entity, Effector<?> effector, java.lang.Throwable throwable)
public static <T> Task<T> invokeEffectorAsync(Entity entity, Effector<T> eff, java.util.Map<java.lang.String,?> parameters)
public static Maybe<Effector<?>> findEffector(java.util.Collection<? extends Effector<?>> effectors, java.lang.String effectorName)
public static Maybe<Effector<?>> findEffectorDeclared(Entity entity, java.lang.String effectorName)