Class SSSOMTDefaultModifierFunction

  • All Implemented Interfaces:
    IFormatModifierFunction

    public class SSSOMTDefaultModifierFunction
    extends Object
    implements IFormatModifierFunction
    Represents the SSSOM/T substitution modifier function "default".

    This function takes one argument. If the substituted value is null or empty (empty string or empty list), the argument is inserted instead.

    For example, the following will insert the value of the mapping_tool slot, or unknown tool if the slot is not set.

     "Mapping tool: %{mapping_tool|default('unknown tool')}"
     
    • Constructor Detail

      • SSSOMTDefaultModifierFunction

        public SSSOMTDefaultModifierFunction()
    • Method Detail

      • call

        public Object call​(Object value,
                           List<String> extra)
        Description copied from interface: IFormatModifierFunction
        Executes the function.
        Specified by:
        call in interface IFormatModifierFunction
        Parameters:
        value - The original value this function is supposed to modify. It is guaranteed never to be null, but the exact type will depend on what the substituted placeholder was, and also on what any previous modifier function may have done with it.
        extra - Additional arguments to the function, if any. If the function declared that it expects some mandatory arguments (through the IFormatModifierFunction.getSignature() method), it is guaranteed the list will contains as many arguments as expected.
        Returns:
        The modified value. It may not need be of the same type as the original value (e.g., a function could transform a list value into a string value).