Interface INodeThrewExceptionBuilder
-
- All Superinterfaces:
org.apache.commons.lang3.builder.Builder<NodeThrewException>
,IAbruptCompletionExceptionBuilder<INodeThrewExceptionBuilder,NodeThrewException>
,ICompletionResultBuilder<INodeThrewExceptionBuilder,NodeThrewException>
public interface INodeThrewExceptionBuilder extends ICompletionResultBuilder<INodeThrewExceptionBuilder,NodeThrewException>, IAbruptCompletionExceptionBuilder<INodeThrewExceptionBuilder,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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description INodeThrewExceptionBuilder
always(IValueCreator<?> alwaysValue)
Sets (replaces) the value made available by the node regardless of whether it was executed successfully (or threw an exception).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).INodeThrewExceptionBuilder
cause(Throwable cause)
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.default <T> INodeThrewExceptionBuilder
error(String errorCode, T value)
Sets (replaces) the error type and value describing the exception in more detail.INodeThrewExceptionBuilder
error(Consumer<IUnionValueBuilder<String>> errorValue)
Sets (replaces) the error type and value describing the exception in more detail.INodeThrewExceptionBuilder
file(IWorkflowFileValue fileValue)
Sets (replaces) the files made available by the plugin when it was executed successfully.default INodeThrewExceptionBuilder
file(File... files)
Sets (replaces) the files made available by the plugin when it was executed successfully.default INodeThrewExceptionBuilder
file(Iterable<File> files)
Sets (replaces) the files made available by the plugin when it was executed successfully.INodeThrewExceptionBuilder
message(String message)
-
-
-
Method Detail
-
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 builder for chaining methods calls.
-
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 builder for chaining methods calls.
-
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 builder for chaining methods calls.
-
cause
INodeThrewExceptionBuilder cause(Throwable cause)
- Specified by:
cause
in interfaceIAbruptCompletionExceptionBuilder<INodeThrewExceptionBuilder,NodeThrewException>
- Parameters:
cause
- The cause that resulted in the returning exception. Since a return is usually intended, you should not have to call this method in most cases.- Returns:
- this for chaining.
-
message
INodeThrewExceptionBuilder message(String message)
- Specified by:
message
in interfaceIAbruptCompletionExceptionBuilder<INodeThrewExceptionBuilder,NodeThrewException>
- Parameters:
message
- The cause that resulted in the returning exception. Since a return is usually intended, you should not have to call this method in most cases.- Returns:
- this for chaining.
-
always
INodeThrewExceptionBuilder always(IValueCreator<?> alwaysValue)
Description copied from interface:ICompletionResultBuilder
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 theIExecutionResultDescriptor.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);
- Specified by:
always
in interfaceICompletionResultBuilder<INodeThrewExceptionBuilder,NodeThrewException>
- Parameters:
alwaysValue
- Function that takes a value builder to create the value.- Returns:
- This builder for chaining methods calls.
-
file
INodeThrewExceptionBuilder file(IWorkflowFileValue fileValue)
Description copied from interface:ICompletionResultBuilder
Sets (replaces) the files made available by the plugin when it was executed successfully. When this method is not called, the default value from theIExecutionResultDescriptor.getFileValueDescriptor()
is used. When this method is called multiple times, only the value supplied by the last invocation is used.- Specified by:
file
in interfaceICompletionResultBuilder<INodeThrewExceptionBuilder,NodeThrewException>
- Parameters:
fileValue
- File or files supplied by the plugin.- Returns:
- This builder for chaining methods calls.
-
always
default INodeThrewExceptionBuilder always(Object alwaysValue)
Description copied from interface:ICompletionResultBuilder
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 theIExecutionResultDescriptor.getAlwaysValueDescriptor(IValueDescriptorFactory)
is used. When this method is called multiple times, only the value supplied by the last invocation is used.- Specified by:
always
in interfaceICompletionResultBuilder<INodeThrewExceptionBuilder,NodeThrewException>
- Parameters:
alwaysValue
- Value made available by the plugin when it was executed.- Returns:
- This builder for chaining methods calls.
-
file
default INodeThrewExceptionBuilder file(File... files)
Description copied from interface:ICompletionResultBuilder
Sets (replaces) the files made available by the plugin when it was executed successfully. When this method is not called, the default value from theIExecutionResultDescriptor.getFileValueDescriptor()
is used. When this method i@Override s called multiple times, only the value supplied by the last invocation is used.- Specified by:
file
in interfaceICompletionResultBuilder<INodeThrewExceptionBuilder,NodeThrewException>
- Parameters:
files
- File or files supplied by the plugin.- Returns:
- This builder for chaining methods calls.
-
file
default INodeThrewExceptionBuilder file(Iterable<File> files)
Description copied from interface:ICompletionResultBuilder
Sets (replaces) the files made available by the plugin when it was executed successfully. When this method is not called, the default value from theIExecutionResultDescriptor.getFileValueDescriptor()
is used. When this method is called multiple times, only the value supplied by the last invocation is used.- Specified by:
file
in interfaceICompletionResultBuilder<INodeThrewExceptionBuilder,NodeThrewException>
- Parameters:
files
- File or files supplied by the plugin.- Returns:
- This builder for chaining methods calls.
-
-