Class DuplicateFieldErrorBuilder
java.lang.Object
com.commercetools.api.models.error.DuplicateFieldErrorBuilder
- All Implemented Interfaces:
Builder<DuplicateFieldError>
DuplicateFieldErrorBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
DuplicateFieldError duplicateFieldError = DuplicateFieldError.builder()
.message("{message}")
.field("{field}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionError-specific additional fields.build()
builds DuplicateFieldError with checking for non-null required valuesbuilds DuplicateFieldError without checking for non-null required valuesduplicateValue
(Object duplicateValue) Conflicting duplicate value.Name of the conflicting field.Conflicting duplicate value.getField()
Name of the conflicting field."A duplicate value $duplicateValue exists for field $field."
Error-specific additional fields."A duplicate value $duplicateValue exists for field $field."
static DuplicateFieldErrorBuilder
of()
factory method for an instance of DuplicateFieldErrorBuilderstatic DuplicateFieldErrorBuilder
of
(DuplicateFieldError template) create builder for DuplicateFieldError instanceError-specific additional fields.
-
Constructor Details
-
DuplicateFieldErrorBuilder
public DuplicateFieldErrorBuilder()
-
-
Method Details
-
message
"A duplicate value $duplicateValue exists for field $field."
- Parameters:
message
- 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
-
field
Name of the conflicting field.
- Parameters:
field
- value to be set- Returns:
- Builder
-
duplicateValue
Conflicting duplicate value.
- Parameters:
duplicateValue
- value to be set- Returns:
- Builder
-
getMessage
"A duplicate value $duplicateValue exists for field $field."
- Returns:
- message
-
getValues
Error-specific additional fields.
- Returns:
- pattern properties
-
getField
Name of the conflicting field.
- Returns:
- field
-
getDuplicateValue
Conflicting duplicate value.
- Returns:
- duplicateValue
-
build
builds DuplicateFieldError with checking for non-null required values- Specified by:
build
in interfaceBuilder<DuplicateFieldError>
- Returns:
- DuplicateFieldError
-
buildUnchecked
builds DuplicateFieldError without checking for non-null required values- Returns:
- DuplicateFieldError
-
of
factory method for an instance of DuplicateFieldErrorBuilder- Returns:
- builder
-
of
create builder for DuplicateFieldError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-