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 valuedescriptionto description.description(Optional<String> description) Initializes the optional valuedescriptionto description.Initializes the optional valueexampleto example.Initializes the optional valueexampleto example.Fill a builder with attribute values from the providedPropertyinstance.Initializes the value for thenameattribute.Initializes the value for thereferenceattribute.validation(Validation validation) Initializes the value for thevalidationattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedPropertyinstance. 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
-
name
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
reference
Initializes the value for thereferenceattribute.- Parameters:
reference- The value for reference- 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
-
example
Initializes the optional valueexampleto example.- Parameters:
example- The value for example- Returns:
thisbuilder for chained invocation
-
example
Initializes the optional valueexampleto example.- Parameters:
example- The value for example- Returns:
thisbuilder for use in a chained invocation
-
validation
Initializes the value for thevalidationattribute.- Parameters:
validation- The value for validation- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableProperty.- Returns:
- An immutable instance of Property
- Throws:
IllegalStateException- if any required attributes are missing
-