Package io.dialob.api.rest
Class ImmutableResponse.Builder
java.lang.Object
io.dialob.api.rest.ImmutableResponse.Builder
- Enclosing class:
- ImmutableResponse
Builds instances of type
ImmutableResponse.
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 TypeMethodDescriptionbuild()Builds a newImmutableResponse.Initializes the value for theerrorattribute.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 theokattribute.Initializes the value for thereasonattribute.
-
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
-
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
-
build
Builds a newImmutableResponse.- Returns:
- An immutable instance of Response
- Throws:
IllegalStateException- if any required attributes are missing
-