Interface InvalidFieldError
- All Superinterfaces:
ErrorObject
Returned when a field has an invalid value.
Example to create an instance using the builder pattern
InvalidFieldError invalidFieldError = InvalidFieldError.builder()
.message("{message}")
.field("{field}")
.build()
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic InvalidFieldErrorBuilder
builder()
builder factory method for InvalidFieldErrorstatic InvalidFieldErrorBuilder
builder
(InvalidFieldError template) create builder for InvalidFieldError instancestatic InvalidFieldError
deepCopy
(InvalidFieldError template) factory method to create a deep copy of InvalidFieldErrorFixed set of allowed values for the field, if any.@NotNull String
getCode()
Error identifier.@NotNull String
getField()
Name of the field with the invalid value.@NotNull Object
Value invalid for the field.@NotNull String
"The value $invalidValue is not valid for field $field."
static InvalidFieldError
of()
factory methodstatic InvalidFieldError
of
(InvalidFieldError template) factory method to create a shallow copy InvalidFieldErrorvoid
setAllowedValues
(Object... allowedValues) Fixed set of allowed values for the field, if any.void
setAllowedValues
(List<Object> allowedValues) Fixed set of allowed values for the field, if any.void
Name of the field with the invalid value.void
setInvalidValue
(Object invalidValue) Value invalid for the field.void
setMessage
(String message) "The value $invalidValue is not valid for field $field."
static com.fasterxml.jackson.core.type.TypeReference<InvalidFieldError>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withInvalidFieldError
(Function<InvalidFieldError, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.error.ErrorObject
setValue, values, withErrorObject
-
Field Details
-
INVALID_FIELD
discriminator value for InvalidFieldError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObject
Error identifier.
- Specified by:
getCode
in interfaceErrorObject
- Returns:
- code
-
getMessage
"The value $invalidValue is not valid for field $field."
- Specified by:
getMessage
in interfaceErrorObject
- Returns:
- message
-
getField
Name of the field with the invalid value.
- Returns:
- field
-
getInvalidValue
Value invalid for the field.
- Returns:
- invalidValue
-
getAllowedValues
Fixed set of allowed values for the field, if any.
- Returns:
- allowedValues
-
setMessage
"The value $invalidValue is not valid for field $field."
- Specified by:
setMessage
in interfaceErrorObject
- Parameters:
message
- value to be set
-
setField
Name of the field with the invalid value.
- Parameters:
field
- value to be set
-
setInvalidValue
Value invalid for the field.
- Parameters:
invalidValue
- value to be set
-
setAllowedValues
Fixed set of allowed values for the field, if any.
- Parameters:
allowedValues
- values to be set
-
setAllowedValues
Fixed set of allowed values for the field, if any.
- Parameters:
allowedValues
- values to be set
-
of
factory method- Returns:
- instance of InvalidFieldError
-
of
factory method to create a shallow copy InvalidFieldError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of InvalidFieldError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for InvalidFieldError- Returns:
- builder
-
builder
create builder for InvalidFieldError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withInvalidFieldError
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
-