Interface DuplicateFieldWithConflictingResourceError
- All Superinterfaces:
ErrorObject
Returned when a field value conflicts with an existing value stored in a particular resource causing a duplicate.
Example to create an instance using the builder pattern
DuplicateFieldWithConflictingResourceError duplicateFieldWithConflictingResourceError = DuplicateFieldWithConflictingResourceError.builder()
.message("{message}")
.field("{field}")
.conflictingResource(conflictingResourceBuilder -> conflictingResourceBuilder)
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for DuplicateFieldWithConflictingResourceError -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for DuplicateFieldWithConflictingResourceErrorcreate builder for DuplicateFieldWithConflictingResourceError instancefactory method to create a deep copy of DuplicateFieldWithConflictingResourceError@NotNull String
getCode()
Error identifier.@NotNull @Valid Reference
Reference to the resource that has the conflicting value.@NotNull Object
Conflicting duplicate value.@NotNull String
getField()
Name of the conflicting field.@NotNull String
"A duplicate value $duplicateValue exists for field $field on $conflictingResource."
of()
factory methodof
(DuplicateFieldWithConflictingResourceError template) factory method to create a shallow copy DuplicateFieldWithConflictingResourceErrorvoid
setConflictingResource
(Reference conflictingResource) Reference to the resource that has the conflicting value.void
setDuplicateValue
(Object duplicateValue) Conflicting duplicate value.void
Name of the conflicting field.void
setMessage
(String message) "A duplicate value $duplicateValue exists for field $field on $conflictingResource."
static com.fasterxml.jackson.core.type.TypeReference<DuplicateFieldWithConflictingResourceError>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withDuplicateFieldWithConflictingResourceError
(Function<DuplicateFieldWithConflictingResourceError, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.error.ErrorObject
setValue, values, withErrorObject
-
Field Details
-
DUPLICATE_FIELD_WITH_CONFLICTING_RESOURCE
discriminator value for DuplicateFieldWithConflictingResourceError- 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 on $conflictingResource."
- Specified by:
getMessage
in interfaceErrorObject
- Returns:
- message
-
getField
Name of the conflicting field.
- Returns:
- field
-
getDuplicateValue
Conflicting duplicate value.
- Returns:
- duplicateValue
-
getConflictingResource
Reference to the resource that has the conflicting value.
- Returns:
- conflictingResource
-
setMessage
"A duplicate value $duplicateValue exists for field $field on $conflictingResource."
- 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
-
setConflictingResource
Reference to the resource that has the conflicting value.
- Parameters:
conflictingResource
- value to be set
-
of
factory method- Returns:
- instance of DuplicateFieldWithConflictingResourceError
-
of
static DuplicateFieldWithConflictingResourceError of(DuplicateFieldWithConflictingResourceError template) factory method to create a shallow copy DuplicateFieldWithConflictingResourceError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static DuplicateFieldWithConflictingResourceError deepCopy(@Nullable DuplicateFieldWithConflictingResourceError template) factory method to create a deep copy of DuplicateFieldWithConflictingResourceError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for DuplicateFieldWithConflictingResourceError- Returns:
- builder
-
builder
static DuplicateFieldWithConflictingResourceErrorBuilder builder(DuplicateFieldWithConflictingResourceError template) create builder for DuplicateFieldWithConflictingResourceError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withDuplicateFieldWithConflictingResourceError
default <T> T withDuplicateFieldWithConflictingResourceError(Function<DuplicateFieldWithConflictingResourceError, T> helper) accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
static com.fasterxml.jackson.core.type.TypeReference<DuplicateFieldWithConflictingResourceError> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-