Interface RequiredFieldError
- All Superinterfaces:
ErrorObject
Returned when a value is not defined for a required field.
Example to create an instance using the builder pattern
RequiredFieldError requiredFieldError = RequiredFieldError.builder()
.message("{message}")
.field("{field}")
.build()
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic RequiredFieldErrorBuilder
builder()
builder factory method for RequiredFieldErrorstatic RequiredFieldErrorBuilder
builder
(RequiredFieldError template) create builder for RequiredFieldError instancestatic RequiredFieldError
deepCopy
(RequiredFieldError template) factory method to create a deep copy of RequiredFieldError@NotNull String
getCode()
Error identifier.@NotNull String
getField()
Name of the field missing the value.@NotNull String
"A value is required for field $field."
static RequiredFieldError
of()
factory methodstatic RequiredFieldError
of
(RequiredFieldError template) factory method to create a shallow copy RequiredFieldErrorvoid
Name of the field missing the value.void
setMessage
(String message) "A value is required for field $field."
static com.fasterxml.jackson.core.type.TypeReference<RequiredFieldError>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withRequiredFieldError
(Function<RequiredFieldError, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.error.ErrorObject
setValue, values, withErrorObject
-
Field Details
-
REQUIRED_FIELD
discriminator value for RequiredFieldError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObject
Error identifier.
- Specified by:
getCode
in interfaceErrorObject
- Returns:
- code
-
getMessage
"A value is required for field $field."
- Specified by:
getMessage
in interfaceErrorObject
- Returns:
- message
-
getField
Name of the field missing the value.
- Returns:
- field
-
setMessage
"A value is required for field $field."
- Specified by:
setMessage
in interfaceErrorObject
- Parameters:
message
- value to be set
-
setField
Name of the field missing the value.
- Parameters:
field
- value to be set
-
of
factory method- Returns:
- instance of RequiredFieldError
-
of
factory method to create a shallow copy RequiredFieldError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of RequiredFieldError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for RequiredFieldError- Returns:
- builder
-
builder
create builder for RequiredFieldError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withRequiredFieldError
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
-