Class Argument

java.lang.Object
com.suncode.pwfl.component.Argument

public class Argument extends Object
Invocation argument. Holds parameter value (single or array) and provides automatic evaluation of functions and variable values.
Author:
Cezary Kozar 31 maj 2016
  • Constructor Details

  • Method Details

    • getParameter

      public ParameterDefinition<?> getParameter()
      Returns component parameter for this argument
    • isArray

      public boolean isArray()
      Returns true if argument value is an array.
    • matches

      public boolean matches(Type<?> parameterType)
      Returns true if this argument matches given type.
      Parameters:
      parameterType - type
      Returns:
    • getRaw

      public Object getRaw()
      Returns this argument value.
      Returns:
    • get

      public Object get()
      Returns this argument value. Value is evaluated in case of functions or variables.
      Returns:
      argument value
    • get

      public <T> T get(Class<T> targetClass)
      Returns this argument value as instance of given class. Value is evaluated in case of functions or variables.
      Parameters:
      targetClass - target class
      Returns:
      argument value
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • wrap

      public static Argument wrap(Object parameterValue, ParameterDefinition<?> parameter)
      Wraps raw parameter value as argument. Value can be single instance or array e.g. Object[].
      Parameters:
      parameterValue - raw parameter value
      parameter - parameter
      Returns:
      argument