Class ExtensionErrorBuilder
java.lang.Object
com.commercetools.api.models.error.ExtensionErrorBuilder
- All Implemented Interfaces:
Builder<ExtensionError>
ExtensionErrorBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ExtensionError extensionError = ExtensionError.builder()
.code("{code}")
.message("{message}")
.extensionId("{extensionId}")
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionError-specific additional fields.build()builds ExtensionError with checking for non-null required valuesbuilds ExtensionError without checking for non-null required valuesError code caused by the Extension.extensionId(String extensionId) Unique identifier of the Extension.extensionKey(String extensionKey) User-defined unique identifier of the Extension.getCode()Error code caused by the Extension.Unique identifier of the Extension.User-defined unique identifier of the Extension.Plain text description of the error.Error-specific additional fields.Plain text description of the error.static ExtensionErrorBuilderof()factory method for an instance of ExtensionErrorBuilderstatic ExtensionErrorBuilderof(ExtensionError template) create builder for ExtensionError instanceError-specific additional fields.
-
Constructor Details
-
ExtensionErrorBuilder
public ExtensionErrorBuilder()
-
-
Method Details
-
code
Error code caused by the Extension. For example,
InvalidField.- Parameters:
code- value to be set- Returns:
- Builder
-
message
Plain text description of the error.
- Parameters:
message- value to be set- Returns:
- Builder
-
extensionId
Unique identifier of the Extension.
- Parameters:
extensionId- value to be set- Returns:
- Builder
-
extensionKey
User-defined unique identifier of the Extension.
- Parameters:
extensionKey- value to be set- Returns:
- Builder
-
values
Error-specific additional fields.
- Parameters:
values- properties to be set- Returns:
- Builder
-
addValue
Error-specific additional fields.
- Parameters:
key- property namevalue- property value- Returns:
- Builder
-
getCode
Error code caused by the Extension. For example,
InvalidField.- Returns:
- code
-
getMessage
Plain text description of the error.
- Returns:
- message
-
getExtensionId
Unique identifier of the Extension.
- Returns:
- extensionId
-
getExtensionKey
User-defined unique identifier of the Extension.
- Returns:
- extensionKey
-
getValues
Error-specific additional fields.
- Returns:
- pattern properties
-
build
builds ExtensionError with checking for non-null required values- Specified by:
buildin interfaceBuilder<ExtensionError>- Returns:
- ExtensionError
-
buildUnchecked
builds ExtensionError without checking for non-null required values- Returns:
- ExtensionError
-
of
factory method for an instance of ExtensionErrorBuilder- Returns:
- builder
-
of
create builder for ExtensionError instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-