Interface INodeThrewExceptionBuilder

  • All Superinterfaces:
    org.apache.commons.lang3.builder.Builder<NodeThrewException>

    public interface INodeThrewExceptionBuilder
    extends org.apache.commons.lang3.builder.Builder<NodeThrewException>
    Builder for the exception thrown by a node when it encounters an error upon execution.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • always

        INodeThrewExceptionBuilder always​(IValueCreator<?> alwaysValue)
        Sets (replaces) the value made available by the node regardless of whether it was executed successfully (or threw an exception). When this method is not called, the default value from the IExecutionResultDescriptor.getAlwaysValueDescriptor(IValueDescriptorFactory) is used. When this method is called multiple times, only the value supplied by the last invocation is used.

        For example, when you wish to return a record with two properties:

         // Corresponds to the JSON object {"foo": "bar", "baz": 42}
         builder.success(b -> b.asRecord().property("foo", "bar").property("baz", 42);
         
        Parameters:
        alwaysValue - Function that takes a value builder to create the value.
        Returns:
        this for chaining.
      • always

        default INodeThrewExceptionBuilder always​(Object alwaysValue)
        Sets (replaces) the value made available by the node regardless of whether it was executed successfully (or threw an exception). When this method is not called, the default value from the IExecutionResultDescriptor.getAlwaysValueDescriptor(IValueDescriptorFactory) is used. When this method is called multiple times, only the value supplied by the last invocation is used.

        For example, when you wish to return a record with two properties:

         // Corresponds to the JSON object {"foo": "bar", "baz": 42}
         builder.success(b -> b.asRecord().property("foo", "bar").property("baz", 42);
         
        Parameters:
        alwaysValue - Function that takes a value builder to create the value.
        Returns:
        this for chaining.
      • cause

        INodeThrewExceptionBuilder cause​(Throwable cause)
        Sets (replaces) the cause responsible for the node to throw. When this method is not called, no cause is set. When this is called multiple times, only the value of the last invocation is used.
        Parameters:
        cause - The underlying exception that caused the node to throw.
        Returns:
        this for chaining.
      • error

        INodeThrewExceptionBuilder error​(Consumer<IUnionValueBuilder<String>> errorValue)
        Sets (replaces) the error type and value describing the exception in more detail. Each node may specify multiple error types. For each error type, it may specify which value are made available when that error occurs (Note that this corresponds to Java exceptions with additional fields containing details about the exception.)
        Parameters:
        errorValue - Function that takes a value builder to create the error value.
        Returns:
        this for chaining.
      • error

        default <T> INodeThrewExceptionBuilder error​(String errorCode,
                                                     Class<T> memberClass,
                                                     IValueCreator<T> valueCreator)
        Sets (replaces) the error type and value describing the exception in more detail. Each node may specify multiple error types. For each error type, it may specify which value are made available when that error occurs (Note that this corresponds to Java exceptions with additional fields containing details about the exception.)
        Type Parameters:
        T - Type of the value for the error type.
        Parameters:
        errorCode - String with the error type.
        memberClass - Type of the value for that error type.
        valueCreator - Function that takes a value builder to create the error value.
        Returns:
        this for chaining.
      • error

        default <T> INodeThrewExceptionBuilder error​(String errorCode,
                                                     T value)
        Sets (replaces) the error type and value describing the exception in more detail. Each node may specify multiple error types. For each error type, it may specify which value are made available when that error occurs (Note that this corresponds to Java exceptions with additional fields containing details about the exception.)
        Type Parameters:
        T - Type of the value for the error type.
        Parameters:
        errorCode - String with the error type.
        value - Value with details about the error.
        Returns:
        this for chaining.
      • file

        default INodeThrewExceptionBuilder file​(File... files)
        Sets (replaces) the files made available by the plugin when it was executed successfully. When this method is not called, the default value from the IExecutionResultDescriptor.getFileValueDescriptor() is used. When this method is called multiple times, only the value supplied by the last invocation is used.
        Parameters:
        files - File or files supplied by the plugin.
        Returns:
        this for chaining.
      • file

        default INodeThrewExceptionBuilder file​(Iterable<File> files)
        Sets (replaces) the files made available by the plugin when it was executed successfully. When this method is not called, the default value from the IExecutionResultDescriptor.getFileValueDescriptor() is used. When this method is called multiple times, only the value supplied by the last invocation is used.
        Parameters:
        files - File or files supplied by the plugin.
        Returns:
        this for chaining.
      • message

        INodeThrewExceptionBuilder message​(String message)
        Sets (replaces) the error message with a short description of the error that occurred.
        Parameters:
        message - Error message of the error responsible for the node's failure.
        Returns:
        this for chaining.