Class DefaultErrorTypeBuilder

java.lang.Object
org.mule.runtime.ast.internal.error.DefaultErrorTypeBuilder
All Implemented Interfaces:
ErrorTypeBuilder

public final class DefaultErrorTypeBuilder extends Object implements ErrorTypeBuilder
Builder for ErrorType. This must be the only mechanism to create an instance of ErrorType.
Since:
1.0
  • Field Details

    • CORE_NAMESPACE_NAME

      public static final String CORE_NAMESPACE_NAME
    • ANY_IDENTIFIER

      public static final String ANY_IDENTIFIER
      Wild card that matches with any error and is on top of the error hierarchy for those that allow handling
    • CRITICAL_IDENTIFIER

      public static final String CRITICAL_IDENTIFIER
  • Method Details

    • builder

      public static DefaultErrorTypeBuilder builder()
      Returns:
      the ErrorTypeBuilder implementation. This must be the only mechanism to create an instance of ErrorType
    • identifier

      public DefaultErrorTypeBuilder identifier(String identifier)
      Sets the error type identifier. @see ErrorType.getIdentifier(). The identifier must be unique within the same namespace.
      Specified by:
      identifier in interface ErrorTypeBuilder
      Parameters:
      identifier - the string representation
      Returns:
      this builder
    • namespace

      public DefaultErrorTypeBuilder namespace(String namespace)
      Sets the error type namespace. @see ErrorType.getNamespace()
      Specified by:
      namespace in interface ErrorTypeBuilder
      Parameters:
      namespace - the error type namespace
      Returns:
      this builder
    • parentErrorType

      public DefaultErrorTypeBuilder parentErrorType(org.mule.runtime.api.message.ErrorType parentErrorType)
      Sets the parent error type. @see ErrorType.getParentErrorType()
      Specified by:
      parentErrorType in interface ErrorTypeBuilder
      Parameters:
      parentErrorType - the parent error type
      Returns:
      this builder
    • build

      public org.mule.runtime.api.message.ErrorType build()
      Creates a new instance of the configured error type.
      Specified by:
      build in interface ErrorTypeBuilder
      Returns:
      the error type with the provided configuration.