Package church.i18n.processing.exception
Class ProcessingExceptionNoopBuilder
java.lang.Object
church.i18n.processing.exception.ProcessingExceptionNoopBuilder
- All Implemented Interfaces:
GenericBuilder<Optional<ProcessingException>>,ProcessingExceptionBuilder,ProcessingExceptionIntermediate<ProcessingExceptionBuilder>,ProcessingMessageBuilderMethods<ProcessingExceptionBuilder>
public class ProcessingExceptionNoopBuilder
extends Object
implements ProcessingMessageBuilderMethods<ProcessingExceptionBuilder>, ProcessingExceptionBuilder
No operation builder. This instance is used to reduce the number of operations used during
building. In the case validation condition fails, the building of an exception is not needed any
more. In this case we can skip all following building operations.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription@NotNull ProcessingExceptionBuilderaddContextInfo(@Nullable ContextInfo... contextInfo) Add contextual information to the message.@NotNull ProcessingExceptionBuilderaddContextInfo(@Nullable List<ContextInfo> contextInfo) Add additional contextual information bounded to message.@NotNull Optional<ProcessingException> build()Build an object.voidBuilds and directly throws built exception.@NotNull StringtoString()@NotNull ProcessingExceptionBuilderwithHelpUri(@NotNull String helpUri) Help URI associated with this message that may help receiver to find more information about the problem, better understand it and resolve it quickly.@NotNull ProcessingExceptionBuilderwithHelpUri(@Nullable URI helpUri) Help URI associated with this message that may help receiver to find more information about the problem, better understand it and resolve it quickly.@NotNull ProcessingExceptionBuilderwithLogLevel(@NotNull LogLevel logLevel) Specify log level of exception.@NotNull ProcessingExceptionBuilderwithMessageType(@Nullable MessageType messageType) Type of message, such as severity or message status.@NotNull ProcessingExceptionBuilderwithSecurityLevel(@Nullable SecurityLevel securityLevel) Specify security level of information in message.@NotNull ProcessingExceptionBuilderwithStatus(@NotNull Status status) Specify the response status of an exception that can be used for system inter-communication.
-
Field Details
-
NO_OP_PROCESSING_EXCEPTION_BUILDER
-
-
Method Details
-
addContextInfo
@NotNull public @NotNull ProcessingExceptionBuilder addContextInfo(@Nullable @Nullable List<ContextInfo> contextInfo) Description copied from interface:ProcessingMessageBuilderMethodsAdd additional contextual information bounded to message. It appends this contextual information to all previously added contextual information.- Specified by:
addContextInfoin interfaceProcessingMessageBuilderMethods<ProcessingExceptionBuilder>- Parameters:
contextInfo- Contextual information you want to provide together with the message.- Returns:
- An instance of an
ProcessingMessageBuilderMethodswith appended contextual information.
-
addContextInfo
@NotNull public @NotNull ProcessingExceptionBuilder addContextInfo(@Nullable @Nullable ContextInfo... contextInfo) Description copied from interface:ProcessingMessageBuilderMethodsAdd contextual information to the message.- Specified by:
addContextInfoin interfaceProcessingMessageBuilderMethods<ProcessingExceptionBuilder>- Parameters:
contextInfo- Additional contextual information appended to message.- Returns:
- An instance of an
ProcessingMessageBuilderMethodswith appended contextual information.
-
withHelpUri
Description copied from interface:ProcessingMessageBuilderMethodsHelp URI associated with this message that may help receiver to find more information about the problem, better understand it and resolve it quickly. It can be reference to the documentation, KB or other article describing problem.- Specified by:
withHelpUriin interfaceProcessingMessageBuilderMethods<ProcessingExceptionBuilder>- Parameters:
helpUri- Resource identifier.- Returns:
- An instance of an
ProcessingMessageBuilderMethodswith appended contextual information.
-
withHelpUri
Description copied from interface:ProcessingMessageBuilderMethodsHelp URI associated with this message that may help receiver to find more information about the problem, better understand it and resolve it quickly. It can be reference to the documentation, KB or other article describing problem.- Specified by:
withHelpUriin interfaceProcessingMessageBuilderMethods<ProcessingExceptionBuilder>- Parameters:
helpUri- Resource identifier.- Returns:
- An instance of an
ProcessingMessageBuilderMethodswith appended contextual information.
-
withSecurityLevel
@NotNull public @NotNull ProcessingExceptionBuilder withSecurityLevel(@Nullable @Nullable SecurityLevel securityLevel) Description copied from interface:ProcessingMessageBuilderMethodsSpecify security level of information in message.- Specified by:
withSecurityLevelin interfaceProcessingMessageBuilderMethods<ProcessingExceptionBuilder>- Parameters:
securityLevel- Security level of information in message.- Returns:
- An instance of an
ProcessingMessageBuilderMethodswith appended contextual information.
-
withMessageType
@NotNull public @NotNull ProcessingExceptionBuilder withMessageType(@Nullable @Nullable MessageType messageType) Description copied from interface:ProcessingMessageBuilderMethodsType of message, such as severity or message status. For more information seeMessageStatusorMessageSeverity.- Specified by:
withMessageTypein interfaceProcessingMessageBuilderMethods<ProcessingExceptionBuilder>- Parameters:
messageType- The type of this message.- Returns:
- An instance of an
ProcessingMessageBuilderMethodswith appended contextual information.
-
build
Description copied from interface:GenericBuilderBuild an object.- Specified by:
buildin interfaceGenericBuilder<Optional<ProcessingException>>- Returns:
- Build non-null object.
-
throwException
public void throwException()Description copied from interface:ProcessingExceptionBuilderBuilds and directly throws built exception.- Specified by:
throwExceptionin interfaceProcessingExceptionBuilder
-
withLogLevel
@NotNull public @NotNull ProcessingExceptionBuilder withLogLevel(@NotNull @NotNull LogLevel logLevel) Description copied from interface:ProcessingExceptionIntermediateSpecify log level of exception.- Specified by:
withLogLevelin interfaceProcessingExceptionIntermediate<ProcessingExceptionBuilder>- Parameters:
logLevel- The log level you want to use.- Returns:
- An instance of object
ProcessingExceptionIntermediate.
-
withStatus
Description copied from interface:ProcessingExceptionIntermediateSpecify the response status of an exception that can be used for system inter-communication.- Specified by:
withStatusin interfaceProcessingExceptionIntermediate<ProcessingExceptionBuilder>- Parameters:
status- Status associated with this exception.- Returns:
- An instance of object
ProcessingExceptionIntermediate.
-
toString
-