Package com.arakelian.faker.model
Class ImmutableRandomDataConfig.Builder
- java.lang.Object
-
- com.arakelian.faker.model.ImmutableRandomDataConfig.Builder
-
- Enclosing class:
- ImmutableRandomDataConfig
@NotThreadSafe public static final class ImmutableRandomDataConfig.Builder extends java.lang.ObjectBuilds instances of typeImmutableRandomDataConfig. 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 ImmutableRandomDataConfigbuild()Builds a newImmutableRandomDataConfig.ImmutableRandomDataConfig.Builderfrom(RandomDataConfig instance)Fill a builder with attribute values from the providedRandomDataConfiginstance.ImmutableRandomDataConfig.BuilderfromBirthday(java.time.ZonedDateTime fromBirthday)Initializes the value for thefromBirthdayattribute.ImmutableRandomDataConfig.Builderrandom(java.util.Random random)Initializes the value for therandomattribute.ImmutableRandomDataConfig.BuildertoBirthday(java.time.ZonedDateTime toBirthday)Initializes the value for thetoBirthdayattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableRandomDataConfig.Builder from(RandomDataConfig instance)
Fill a builder with attribute values from the providedRandomDataConfiginstance. 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
-
fromBirthday
@CanIgnoreReturnValue public final ImmutableRandomDataConfig.Builder fromBirthday(java.time.ZonedDateTime fromBirthday)
Initializes the value for thefromBirthdayattribute.If not set, this attribute will have a default value as returned by the initializer of
fromBirthday.- Parameters:
fromBirthday- The value for fromBirthday- Returns:
thisbuilder for use in a chained invocation
-
random
@CanIgnoreReturnValue public final ImmutableRandomDataConfig.Builder random(java.util.Random random)
Initializes the value for therandomattribute.If not set, this attribute will have a default value as returned by the initializer of
random.- Parameters:
random- The value for random- Returns:
thisbuilder for use in a chained invocation
-
toBirthday
@CanIgnoreReturnValue public final ImmutableRandomDataConfig.Builder toBirthday(java.time.ZonedDateTime toBirthday)
Initializes the value for thetoBirthdayattribute.If not set, this attribute will have a default value as returned by the initializer of
toBirthday.- Parameters:
toBirthday- The value for toBirthday- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableRandomDataConfig build()
Builds a newImmutableRandomDataConfig.- Returns:
- An immutable instance of RandomDataConfig
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-