Package io.dialob.api.form
Class ImmutableFormPutResponse.Builder
java.lang.Object
io.dialob.api.form.ImmutableFormPutResponse.Builder
- Enclosing class:
- ImmutableFormPutResponse
Builds instances of type
ImmutableFormPutResponse.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionaddAllErrors(Iterable<? extends FormValidationError> elements) Adds elements toerrorslist.addErrors(FormValidationError element) Adds one element toerrorslist.addErrors(FormValidationError... elements) Adds elements toerrorslist.build()Builds a newImmutableFormPutResponse.Initializes the value for theerrorattribute.errors(Iterable<? extends FormValidationError> elements) Sets or replaces all elements forerrorslist.Initializes the value for theformattribute.from(FormPutResponse instance) Fill a builder with attribute values from the providedio.dialob.api.form.FormPutResponseinstance.Fill a builder with attribute values from the providedio.dialob.api.rest.Responseinstance.from(ResponseStatus instance) Fill a builder with attribute values from the providedio.dialob.api.rest.ResponseStatusinstance.Initializes the value for theidattribute.Initializes the value for theokattribute.Initializes the value for thereasonattribute.Initializes the value for therevattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedio.dialob.api.rest.Responseinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedio.dialob.api.rest.ResponseStatusinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedio.dialob.api.form.FormPutResponseinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
ok
Initializes the value for theokattribute.- Parameters:
ok- The value for ok (can benull)- Returns:
thisbuilder for use in a chained invocation
-
error
Initializes the value for theerrorattribute.- Parameters:
error- The value for error (can benull)- Returns:
thisbuilder for use in a chained invocation
-
reason
Initializes the value for thereasonattribute.- Parameters:
reason- The value for reason (can benull)- Returns:
thisbuilder for use in a chained invocation
-
id
Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
rev
Initializes the value for therevattribute.- Parameters:
rev- The value for rev (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addErrors
Adds one element toerrorslist.- Parameters:
element- A errors element- Returns:
thisbuilder for use in a chained invocation
-
addErrors
Adds elements toerrorslist.- Parameters:
elements- An array of errors elements- Returns:
thisbuilder for use in a chained invocation
-
errors
public final ImmutableFormPutResponse.Builder errors(Iterable<? extends FormValidationError> elements) Sets or replaces all elements forerrorslist.- Parameters:
elements- An iterable of errors elements- Returns:
thisbuilder for use in a chained invocation
-
addAllErrors
public final ImmutableFormPutResponse.Builder addAllErrors(Iterable<? extends FormValidationError> elements) Adds elements toerrorslist.- Parameters:
elements- An iterable of errors elements- Returns:
thisbuilder for use in a chained invocation
-
form
Initializes the value for theformattribute.- Parameters:
form- The value for form (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableFormPutResponse.- Returns:
- An immutable instance of FormPutResponse
- Throws:
IllegalStateException- if any required attributes are missing
-