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.Buildercontact(Info.Contact contact) Initializes the value for thecontactattribute.final ImmutableInfo.Builderdescription(String description) Initializes the optional valuedescriptionto description.final ImmutableInfo.Builderdescription(Optional<String> description) Initializes the optional valuedescriptionto description.final ImmutableInfo.BuilderFill a builder with attribute values from the providedInfoinstance.final ImmutableInfo.BuildertermsOfService(String termsOfService) Initializes the optional valuetermsOfServiceto termsOfService.final ImmutableInfo.BuildertermsOfService(Optional<String> termsOfService) Initializes the optional valuetermsOfServiceto termsOfService.final ImmutableInfo.BuilderInitializes the value for thetitleattribute.final ImmutableInfo.BuilderInitializes the value for theversionattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedInfoinstance. 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:
thisbuilder for use in a chained invocation
-
title
Initializes the value for thetitleattribute.- Parameters:
title- The value for title- Returns:
thisbuilder for use in a chained invocation
-
version
Initializes the value for theversionattribute.- Parameters:
version- The value for version- Returns:
thisbuilder for use in a chained invocation
-
description
Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for chained invocation
-
description
Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for use in a chained invocation
-
termsOfService
Initializes the optional valuetermsOfServiceto termsOfService.- Parameters:
termsOfService- The value for termsOfService- Returns:
thisbuilder for chained invocation
-
termsOfService
Initializes the optional valuetermsOfServiceto termsOfService.- Parameters:
termsOfService- The value for termsOfService- Returns:
thisbuilder for use in a chained invocation
-
contact
Initializes the value for thecontactattribute.If not set, this attribute will have a default value as returned by the initializer of
contact.- Parameters:
contact- The value for contact- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableInfo.- Returns:
- An immutable instance of Info
- Throws:
IllegalStateException- if any required attributes are missing
-