Package dk.mada.jaxrs.model
Class ImmutableInfo.Builder
java.lang.Object
dk.mada.jaxrs.model.ImmutableInfo.Builder
- Enclosing class:
ImmutableInfo
@Generated(from="Info",
generator="Immutables")
public static final class ImmutableInfo.Builder
extends Object
Builds instances of type
ImmutableInfo
.
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 newImmutableInfo
.final ImmutableInfo.Builder
contact
(Info.Contact contact) Initializes the value for thecontact
attribute.final ImmutableInfo.Builder
description
(String description) Initializes the optional valuedescription
to description.final ImmutableInfo.Builder
description
(Optional<String> description) Initializes the optional valuedescription
to description.final ImmutableInfo.Builder
Fill a builder with attribute values from the providedInfo
instance.final ImmutableInfo.Builder
termsOfService
(String termsOfService) Initializes the optional valuetermsOfService
to termsOfService.final ImmutableInfo.Builder
termsOfService
(Optional<String> termsOfService) Initializes the optional valuetermsOfService
to termsOfService.final ImmutableInfo.Builder
Initializes the value for thetitle
attribute.final ImmutableInfo.Builder
Initializes the value for theversion
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedInfo
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
title
Initializes the value for thetitle
attribute.- Parameters:
title
- The value for title- Returns:
this
builder for use in a chained invocation
-
version
Initializes the value for theversion
attribute.- Parameters:
version
- The value for version- Returns:
this
builder for use in a chained invocation
-
description
Initializes the optional valuedescription
to description.- Parameters:
description
- The value for description- Returns:
this
builder for chained invocation
-
description
Initializes the optional valuedescription
to description.- Parameters:
description
- The value for description- Returns:
this
builder for use in a chained invocation
-
termsOfService
Initializes the optional valuetermsOfService
to termsOfService.- Parameters:
termsOfService
- The value for termsOfService- Returns:
this
builder for chained invocation
-
termsOfService
Initializes the optional valuetermsOfService
to termsOfService.- Parameters:
termsOfService
- The value for termsOfService- Returns:
this
builder for use in a chained invocation
-
contact
Initializes the value for thecontact
attribute.If not set, this attribute will have a default value as returned by the initializer of
contact
.- Parameters:
contact
- The value for contact- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableInfo
.- Returns:
- An immutable instance of Info
- Throws:
IllegalStateException
- if any required attributes are missing
-