Interface Literal<T>

Type Parameters:
T - the generic type of the actual parameter type

@NoImplement @MinMuleVersion("4.5.0") public interface Literal<T>
A parameter type which allows to get values as they were provided in the DSL, preventing the runtime from resolving expressions or applying any transformations. This is useful when such evaluation should be delegated into a third party.

In the particular case of configurations and connection providers, using literal parameters allows that configuration to be treated as a static one instead of dynamic. This is so because the literal value is constant, even if that literal is actually an expression. Because the runtime won't be evaluating it automatically, it's an static value, from the extension's point of view.

If the value was provided as an expression, this class will provide such expression but will offer no way to actually evaluate it. Use ParameterResolver for that. Finally, a super important consideration to have is the generic type. The ParameterModel derived from uses of this interface will have its type set according to the generic type. The generic is not optional

Since:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    The parameter's literal value, as was written in the DSL
     
  • Method Details

    • getLiteralValue

      Optional<String> getLiteralValue()
      The parameter's literal value, as was written in the DSL
      Returns:
      the literal value or Optional.empty() if the value was not provided
    • getType

      Class<T> getType()
      Returns:
      The actual type of the parameter