Class DynamicArgument<CT,​RT>

  • Type Parameters:
    CT - the context type
    RT - the result type

    @PublicAPI
    public abstract class DynamicArgument<CT,​RT>
    extends ServiceArgument<RT>
    ServiceArguments implementing this interface should support automatic evaluation of arguments before service call based on context.
    NOTE: subclasses MUST HAVE default constructor to use from Marvin Sketch
    Since:
    5.6
    • Constructor Detail

      • DynamicArgument

        protected DynamicArgument()
      • DynamicArgument

        protected DynamicArgument​(String expression)
    • Method Detail

      • setExpression

        public void setExpression​(String expression)
        Sets the expression
        Parameters:
        expression - used for evaluation
      • getExpression

        public String getExpression()
        Returns the expression used for evaluations
        Returns:
        the expression used for evaluations
      • evaluate

        public abstract RT evaluate​(CT context)
        Evaluates the dynamic argument based on context
        Parameters:
        context - the context of evalution
        Returns:
        the evaluated value
      • isValid

        public boolean isValid()
        Description copied from class: ServiceArgument
        Returns true if service argument is valid
        Overrides:
        isValid in class ServiceArgument<RT>
        Returns:
        true if service argument is valid
      • getPlaceholderText

        public String getPlaceholderText()
        Returns the value placeholder text. Defalult implementation returns the String <Calculated>
        Returns:
        the value placeholder text