Package dk.mada.jaxrs.model
Class ImmutableProperty.Builder
java.lang.Object
dk.mada.jaxrs.model.ImmutableProperty.Builder
- Enclosing class:
ImmutableProperty
@Generated(from="Property",
generator="Immutables")
public static final class ImmutableProperty.Builder
extends Object
Builds instances of type
ImmutableProperty
.
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 newImmutableProperty
.description
(String description) Initializes the optional valuedescription
to description.description
(Optional<String> description) Initializes the optional valuedescription
to description.Initializes the optional valueexample
to example.Initializes the optional valueexample
to example.Fill a builder with attribute values from the providedProperty
instance.Initializes the value for thename
attribute.Initializes the value for thereference
attribute.validation
(Validation validation) Initializes the value for thevalidation
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedProperty
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
-
name
Initializes the value for thename
attribute.- Parameters:
name
- The value for name- Returns:
this
builder for use in a chained invocation
-
reference
Initializes the value for thereference
attribute.- Parameters:
reference
- The value for reference- 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
-
example
Initializes the optional valueexample
to example.- Parameters:
example
- The value for example- Returns:
this
builder for chained invocation
-
example
Initializes the optional valueexample
to example.- Parameters:
example
- The value for example- Returns:
this
builder for use in a chained invocation
-
validation
Initializes the value for thevalidation
attribute.- Parameters:
validation
- The value for validation- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableProperty
.- Returns:
- An immutable instance of Property
- Throws:
IllegalStateException
- if any required attributes are missing
-