Interface DuplicateFieldError
- All Superinterfaces:
ErrorObject
Returned when a field value conflicts with an existing value causing a duplicate.
Example to create an instance using the builder pattern
DuplicateFieldError duplicateFieldError = DuplicateFieldError.builder()
.message("{message}")
.field("{field}")
.build()
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DuplicateFieldErrorBuilder
builder()
builder factory method for DuplicateFieldErrorstatic DuplicateFieldErrorBuilder
builder
(DuplicateFieldError template) create builder for DuplicateFieldError instancestatic DuplicateFieldError
deepCopy
(DuplicateFieldError template) factory method to create a deep copy of DuplicateFieldError@NotNull String
getCode()
Error identifier.@NotNull Object
Conflicting duplicate value.@NotNull String
getField()
Name of the conflicting field.@NotNull String
"A duplicate value $duplicateValue exists for field $field."
static DuplicateFieldError
of()
factory methodstatic DuplicateFieldError
of
(DuplicateFieldError template) factory method to create a shallow copy DuplicateFieldErrorvoid
setDuplicateValue
(Object duplicateValue) Conflicting duplicate value.void
Name of the conflicting field.void
setMessage
(String message) "A duplicate value $duplicateValue exists for field $field."
static com.fasterxml.jackson.core.type.TypeReference<DuplicateFieldError>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withDuplicateFieldError
(Function<DuplicateFieldError, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.error.ErrorObject
setValue, values, withErrorObject
-
Field Details
-
DUPLICATE_FIELD
discriminator value for DuplicateFieldError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObject
Error identifier.
- Specified by:
getCode
in interfaceErrorObject
- Returns:
- code
-
getMessage
"A duplicate value $duplicateValue exists for field $field."
- Specified by:
getMessage
in interfaceErrorObject
- Returns:
- message
-
getField
Name of the conflicting field.
- Returns:
- field
-
getDuplicateValue
Conflicting duplicate value.
- Returns:
- duplicateValue
-
setMessage
"A duplicate value $duplicateValue exists for field $field."
- Specified by:
setMessage
in interfaceErrorObject
- Parameters:
message
- value to be set
-
setField
Name of the conflicting field.
- Parameters:
field
- value to be set
-
setDuplicateValue
Conflicting duplicate value.
- Parameters:
duplicateValue
- value to be set
-
of
factory method- Returns:
- instance of DuplicateFieldError
-
of
factory method to create a shallow copy DuplicateFieldError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of DuplicateFieldError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for DuplicateFieldError- Returns:
- builder
-
builder
create builder for DuplicateFieldError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withDuplicateFieldError
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-