Package com.arakelian.faker.model
Class ImmutableAddress.Builder
- java.lang.Object
-
- com.arakelian.faker.model.ImmutableAddress.Builder
-
- Enclosing class:
- ImmutableAddress
@NotThreadSafe public static final class ImmutableAddress.Builder extends java.lang.ObjectBuilds instances of typeImmutableAddress. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableAddressbuild()Builds a newImmutableAddress.ImmutableAddress.Buildercity(java.lang.String city)Initializes the value for thecityattribute.ImmutableAddress.Buildercreated(java.time.ZonedDateTime created)Initializes the value for thecreatedattribute.ImmutableAddress.Builderfrom(AbstractModel instance)Fill a builder with attribute values from the providedcom.arakelian.faker.model.AbstractModelinstance.ImmutableAddress.Builderfrom(Address instance)Fill a builder with attribute values from the providedcom.arakelian.faker.model.Addressinstance.ImmutableAddress.Builderfrom(com.arakelian.store.feature.HasId instance)Fill a builder with attribute values from the providedcom.arakelian.store.feature.HasIdinstance.ImmutableAddress.Builderfrom(com.arakelian.store.feature.HasTimestamp instance)Fill a builder with attribute values from the providedcom.arakelian.store.feature.HasTimestampinstance.ImmutableAddress.Builderid(java.lang.String id)Initializes the value for theidattribute.ImmutableAddress.BuilderpostalCode(java.lang.String postalCode)Initializes the value for thepostalCodeattribute.ImmutableAddress.Builderstate(java.lang.String state)Initializes the value for thestateattribute.ImmutableAddress.Builderstreet(java.lang.String street)Initializes the value for thestreetattribute.ImmutableAddress.Builderupdated(java.time.ZonedDateTime updated)Initializes the value for theupdatedattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableAddress.Builder from(com.arakelian.store.feature.HasId instance)
Fill a builder with attribute values from the providedcom.arakelian.store.feature.HasIdinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableAddress.Builder from(AbstractModel instance)
Fill a builder with attribute values from the providedcom.arakelian.faker.model.AbstractModelinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableAddress.Builder from(com.arakelian.store.feature.HasTimestamp instance)
Fill a builder with attribute values from the providedcom.arakelian.store.feature.HasTimestampinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableAddress.Builder from(Address instance)
Fill a builder with attribute values from the providedcom.arakelian.faker.model.Addressinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
created
@CanIgnoreReturnValue public final ImmutableAddress.Builder created(java.time.ZonedDateTime created)
Initializes the value for thecreatedattribute.If not set, this attribute will have a default value as returned by the initializer of
created.- Parameters:
created- The value for created- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableAddress.Builder id(java.lang.String id)
Initializes the value for theidattribute.If not set, this attribute will have a default value as returned by the initializer of
id.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
updated
@CanIgnoreReturnValue public final ImmutableAddress.Builder updated(java.time.ZonedDateTime updated)
Initializes the value for theupdatedattribute.If not set, this attribute will have a default value as returned by the initializer of
updated.- Parameters:
updated- The value for updated- Returns:
thisbuilder for use in a chained invocation
-
city
@CanIgnoreReturnValue public final ImmutableAddress.Builder city(java.lang.String city)
Initializes the value for thecityattribute.- Parameters:
city- The value for city- Returns:
thisbuilder for use in a chained invocation
-
postalCode
@CanIgnoreReturnValue public final ImmutableAddress.Builder postalCode(java.lang.String postalCode)
Initializes the value for thepostalCodeattribute.- Parameters:
postalCode- The value for postalCode- Returns:
thisbuilder for use in a chained invocation
-
state
@CanIgnoreReturnValue public final ImmutableAddress.Builder state(java.lang.String state)
Initializes the value for thestateattribute.- Parameters:
state- The value for state- Returns:
thisbuilder for use in a chained invocation
-
street
@CanIgnoreReturnValue public final ImmutableAddress.Builder street(java.lang.String street)
Initializes the value for thestreetattribute.- Parameters:
street- The value for street- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableAddress build()
Builds a newImmutableAddress.- Returns:
- An immutable instance of Address
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-