@NotThreadSafe
public static final class ImmutablePerson.Builder
extends java.lang.Object
ImmutablePerson.
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.
| Modifier and Type | Method and Description |
|---|---|
ImmutablePerson.Builder |
age(java.lang.Integer age)
Initializes the value for the
age attribute. |
ImmutablePerson.Builder |
birthdate(java.time.ZonedDateTime birthdate)
Initializes the value for the
birthdate attribute. |
ImmutablePerson |
build()
Builds a new
ImmutablePerson. |
ImmutablePerson.Builder |
comments(java.lang.String comments)
Initializes the value for the
comments attribute. |
ImmutablePerson.Builder |
created(java.time.ZonedDateTime created)
Initializes the value for the
created attribute. |
ImmutablePerson.Builder |
firstName(java.lang.String firstName)
Initializes the value for the
firstName attribute. |
ImmutablePerson.Builder |
from(AbstractModel instance)
Fill a builder with attribute values from the provided
com.arakelian.faker.model.AbstractModel instance. |
ImmutablePerson.Builder |
from(com.arakelian.store.feature.HasId instance)
Fill a builder with attribute values from the provided
com.arakelian.store.feature.HasId instance. |
ImmutablePerson.Builder |
from(com.arakelian.store.feature.HasTimestamp instance)
Fill a builder with attribute values from the provided
com.arakelian.store.feature.HasTimestamp instance. |
ImmutablePerson.Builder |
from(Person instance)
Fill a builder with attribute values from the provided
com.arakelian.faker.model.Person instance. |
ImmutablePerson.Builder |
gender(Gender gender)
Initializes the value for the
gender attribute. |
ImmutablePerson.Builder |
id(java.lang.String id)
Initializes the value for the
id attribute. |
ImmutablePerson.Builder |
lastName(java.lang.String lastName)
Initializes the value for the
lastName attribute. |
ImmutablePerson.Builder |
properties(java.util.Map<java.lang.String,? extends java.lang.Object> entries)
Sets or replaces all mappings from the specified map as entries for the
properties map. |
ImmutablePerson.Builder |
putAllProperties(java.util.Map<java.lang.String,? extends java.lang.Object> entries)
Put all mappings from the specified map as entries to
properties map. |
ImmutablePerson.Builder |
putProperty(java.util.Map.Entry<java.lang.String,? extends java.lang.Object> entry)
Put one entry to the
properties map. |
ImmutablePerson.Builder |
putProperty(java.lang.String key,
java.lang.Object value)
Put one entry to the
properties map. |
ImmutablePerson.Builder |
title(java.lang.String title)
Initializes the value for the
title attribute. |
ImmutablePerson.Builder |
updated(java.time.ZonedDateTime updated)
Initializes the value for the
updated attribute. |
@CanIgnoreReturnValue public final ImmutablePerson.Builder from(com.arakelian.store.feature.HasId instance)
com.arakelian.store.feature.HasId instance.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder from(Person instance)
com.arakelian.faker.model.Person instance.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder from(AbstractModel instance)
com.arakelian.faker.model.AbstractModel instance.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder from(com.arakelian.store.feature.HasTimestamp instance)
com.arakelian.store.feature.HasTimestamp instance.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder age(java.lang.Integer age)
age attribute.
If not set, this attribute will have a default value as returned by the initializer of age.
age - The value for age (can be null)this builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder birthdate(java.time.ZonedDateTime birthdate)
birthdate attribute.birthdate - The value for birthdate (can be null)this builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder comments(java.lang.String comments)
comments attribute.comments - The value for comments (can be null)this builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder firstName(java.lang.String firstName)
firstName attribute.firstName - The value for firstNamethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder gender(Gender gender)
gender attribute.gender - The value for gender (can be null)this builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder lastName(java.lang.String lastName)
lastName attribute.lastName - The value for lastNamethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder putProperty(java.lang.String key, java.lang.Object value)
properties map.key - The key in the properties mapvalue - The associated value in the properties mapthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder putProperty(java.util.Map.Entry<java.lang.String,? extends java.lang.Object> entry)
properties map. Nulls are not permittedentry - The key and value entrythis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder properties(java.util.Map<java.lang.String,? extends java.lang.Object> entries)
properties map. Nulls are not permittedentries - The entries that will be added to the properties mapthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder putAllProperties(java.util.Map<java.lang.String,? extends java.lang.Object> entries)
properties map. Nulls are not permittedentries - The entries that will be added to the properties mapthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder title(java.lang.String title)
title attribute.title - The value for title (can be null)this builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder created(java.time.ZonedDateTime created)
created attribute.
If not set, this attribute will have a default value as returned by the initializer of created.
created - The value for createdthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder id(java.lang.String id)
id attribute.
If not set, this attribute will have a default value as returned by the initializer of id.
id - The value for idthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutablePerson.Builder updated(java.time.ZonedDateTime updated)
updated attribute.
If not set, this attribute will have a default value as returned by the initializer of updated.
updated - The value for updatedthis builder for use in a chained invocationpublic ImmutablePerson build()
ImmutablePerson.java.lang.IllegalStateException - if any required attributes are missing