Interface ISuccessResultBuilder<TBuilder,TResult>
- Type Parameters:
TBuilder- The type of the builder returned by the various builder methods.TResult- The type of the result being built by the builder.
- All Superinterfaces:
org.apache.commons.lang3.builder.Builder<TResult>, ICompletionResultBuilder<TBuilder,TResult>
- All Known Subinterfaces:
INodeReturnedExceptionBuilder, INodeTransferredControlExceptionBuilder, INormalCompletionResultBuilder
public interface ISuccessResultBuilder<TBuilder,TResult>
extends ICompletionResultBuilder<TBuilder,TResult>
Builder for the result of a node when it was executed successfully.
- Since:
- 7.0.7
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> TBuildersoftError(String errorCode, Class<T> memberClass, String message, IValueCreator valueCreator, Throwable cause) Deprecated.softError(String errorCode, String message, IValueCreator valueCreator, Throwable cause) Adds a soft error to the list of soft errors.default TBuilderAdds a soft error to the list of soft errors.softError(String message, Throwable cause, Consumer<IUnionValueBuilder> errorValue) Deprecated.success(IValueCreator successValue) Sets (replaces) the value returned by the node when it was executed successfully.default TBuilderSets (replaces) the value returned by the node when it was executed successfully.Methods inherited from interface org.apache.commons.lang3.builder.Builder
buildMethods inherited from interface ICompletionResultBuilder
always, always, attachment, attachment, attachment, file, file, file, file, file, file
-
Method Details
-
softError
@Deprecated default <T> TBuilder softError(String errorCode, Class<T> memberClass, String message, IValueCreator valueCreator, Throwable cause) Deprecated.UsesoftError(String, String, IValueCreator, Throwable). The member class is not required anymore.Adds a soft error to the list of soft errors. When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. SeesoftErrorsfor more details.- Parameters:
errorCode- String with the soft error type.memberClass- Unused. Will be removed in a future version.message- Message providing more details about the error .valueCreator- Function that takes a value builder to create the soft error value.cause- The exception that caused the soft error. May benullwhen not caused by any exception.- Returns:
- This builder for chaining methods calls.
- Since:
- 7.0.7
-
softError
Adds a soft error to the list of soft errors. When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. SeesoftErrorsfor more details.- Parameters:
errorCode- String with the soft error type.message- Message providing more details about the error .valueCreator- Function that takes a value builder to create the soft error value.cause- The exception that caused the soft error. May benullwhen not caused by any exception.- Returns:
- This builder for chaining methods calls.
- Since:
- 8.1.0
-
softError
Adds a soft error to the list of soft errors. When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. SeesoftErrorsfor more details.- Parameters:
errorCode- String with the error type.message- Message providing more details about the error .value- Value with details about the error.cause- The exception that caused the soft error. May benullwhen not caused by any exception.- Returns:
- This builder for chaining methods calls.
- Since:
- 7.0.7
-
softError
@Deprecated TBuilder softError(String message, Throwable cause, Consumer<IUnionValueBuilder> errorValue) Deprecated.Adds a soft error to the list of soft errors. When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. SeesoftErrorsfor more details.// Adds a soft error with no additional data. builder.softError("bad data", b -> b.value("FOUND_BAD_DATA", new HashMap<>()));- Parameters:
message- Message providing more details about the error .cause- The exception that caused the soft error. May benullwhen not caused by any exception.errorValue- Function that takes a value builder to create the error value.- Returns:
- This builder for chaining methods calls.
- Since:
- 7.0.7
-
success
Sets (replaces) the value returned by the node when it was executed successfully. This value is ignored unless the node was actually executed successfully. When this method is not called, the default value from theIExecutionResultDescriptor.getSuccessValueDescriptor(IValueDescriptorFactory)is used. When this method is called multiple times, only the value supplied by the last invocation gets 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:
successValue- Function that takes a value builder to create the value.- Returns:
- This builder for chaining methods calls.
-
success
Sets (replaces) the value returned by the node when it was executed successfully. This value is ignored unless the node was actually executed successfully. When this method is not called, the default value from theIExecutionResultDescriptor.getSuccessValueDescriptor(IValueDescriptorFactory)is used. When this method is called multiple times, only the value supplied by the last invocation gets used.- Parameters:
value- Value made available by the plugin when it was executed successfully.- Returns:
- This builder for chaining methods calls.
-
softError(String, String, IValueCreator, Throwable).