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