Package com.arakelian.faker.model
Class ImmutablePerson
- java.lang.Object
-
- com.arakelian.faker.model.AbstractModel
-
- com.arakelian.faker.model.Person
-
- com.arakelian.faker.model.ImmutablePerson
-
- All Implemented Interfaces:
com.arakelian.store.feature.HasId,com.arakelian.store.feature.HasTimestamp,java.io.Serializable,java.lang.Comparable<com.arakelian.store.feature.HasId>
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePerson extends PersonImmutable implementation ofPerson.Use the builder to create immutable instances:
ImmutablePerson.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutablePerson.BuilderBuilds instances of typeImmutablePerson.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutablePerson.Builderbuilder()Creates a builder forImmutablePerson.static ImmutablePersoncopyOf(Person instance)Creates an immutable copy of aPersonvalue.java.lang.IntegergetAge()java.time.ZonedDateTimegetBirthdate()java.lang.StringgetComments()java.time.ZonedDateTimegetCreated()java.lang.StringgetFirstName()GendergetGender()java.lang.StringgetId()java.lang.StringgetLastName()com.google.common.collect.ImmutableMap<java.lang.String,java.lang.Object>getProperties()java.lang.StringgetTitle()java.time.ZonedDateTimegetUpdated()java.lang.StringtoString()Prints the immutable valuePersonwith attribute values.ImmutablePersonwithAge(java.lang.Integer value)Copy the current immutable object by setting a value for theageattribute.ImmutablePersonwithBirthdate(java.time.ZonedDateTime value)Copy the current immutable object by setting a value for thebirthdateattribute.ImmutablePersonwithComments(java.lang.String value)Copy the current immutable object by setting a value for thecommentsattribute.ImmutablePersonwithCreated(java.time.ZonedDateTime value)Copy the current immutable object by setting a value for thecreatedattribute.ImmutablePersonwithFirstName(java.lang.String value)Copy the current immutable object by setting a value for thefirstNameattribute.ImmutablePersonwithGender(Gender value)Copy the current immutable object by setting a value for thegenderattribute.ImmutablePersonwithId(java.lang.String value)Copy the current immutable object by setting a value for theidattribute.ImmutablePersonwithLastName(java.lang.String value)Copy the current immutable object by setting a value for thelastNameattribute.ImmutablePersonwithProperties(java.util.Map<java.lang.String,? extends java.lang.Object> entries)Copy the current immutable object by replacing thepropertiesmap with the specified map.ImmutablePersonwithTitle(java.lang.String value)Copy the current immutable object by setting a value for thetitleattribute.ImmutablePersonwithUpdated(java.time.ZonedDateTime value)Copy the current immutable object by setting a value for theupdatedattribute.-
Methods inherited from class com.arakelian.faker.model.AbstractModel
compareTo
-
-
-
-
Method Detail
-
getCreated
public java.time.ZonedDateTime getCreated()
- Specified by:
getCreatedin interfacecom.arakelian.store.feature.HasTimestamp- Overrides:
getCreatedin classAbstractModel- Returns:
- The value of the
createdattribute
-
getId
public java.lang.String getId()
- Specified by:
getIdin interfacecom.arakelian.store.feature.HasId- Overrides:
getIdin classAbstractModel- Returns:
- The value of the
idattribute
-
getUpdated
public java.time.ZonedDateTime getUpdated()
- Specified by:
getUpdatedin interfacecom.arakelian.store.feature.HasTimestamp- Overrides:
getUpdatedin classAbstractModel- Returns:
- The value of the
updatedattribute
-
getAge
public java.lang.Integer getAge()
-
getBirthdate
public java.time.ZonedDateTime getBirthdate()
- Specified by:
getBirthdatein classPerson- Returns:
- The value of the
birthdateattribute
-
getComments
public java.lang.String getComments()
- Specified by:
getCommentsin classPerson- Returns:
- The value of the
commentsattribute
-
getFirstName
public java.lang.String getFirstName()
- Specified by:
getFirstNamein classPerson- Returns:
- The value of the
firstNameattribute
-
getGender
public Gender getGender()
-
getLastName
public java.lang.String getLastName()
- Specified by:
getLastNamein classPerson- Returns:
- The value of the
lastNameattribute
-
getProperties
public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.Object> getProperties()
- Overrides:
getPropertiesin classPerson- Returns:
- The value of the
propertiesattribute
-
getTitle
public java.lang.String getTitle()
-
withCreated
public final ImmutablePerson withCreated(java.time.ZonedDateTime value)
Copy the current immutable object by setting a value for thecreatedattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for created- Returns:
- A modified copy of the
thisobject
-
withId
public final ImmutablePerson withId(java.lang.String value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withUpdated
public final ImmutablePerson withUpdated(java.time.ZonedDateTime value)
Copy the current immutable object by setting a value for theupdatedattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for updated- Returns:
- A modified copy of the
thisobject
-
withAge
public final ImmutablePerson withAge(java.lang.Integer value)
Copy the current immutable object by setting a value for theageattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for age (can benull)- Returns:
- A modified copy of the
thisobject
-
withBirthdate
public final ImmutablePerson withBirthdate(java.time.ZonedDateTime value)
Copy the current immutable object by setting a value for thebirthdateattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for birthdate (can benull)- Returns:
- A modified copy of the
thisobject
-
withComments
public final ImmutablePerson withComments(java.lang.String value)
Copy the current immutable object by setting a value for thecommentsattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for comments (can benull)- Returns:
- A modified copy of the
thisobject
-
withFirstName
public final ImmutablePerson withFirstName(java.lang.String value)
Copy the current immutable object by setting a value for thefirstNameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for firstName- Returns:
- A modified copy of the
thisobject
-
withGender
public final ImmutablePerson withGender(Gender value)
Copy the current immutable object by setting a value for thegenderattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for gender (can benull)- Returns:
- A modified copy of the
thisobject
-
withLastName
public final ImmutablePerson withLastName(java.lang.String value)
Copy the current immutable object by setting a value for thelastNameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for lastName- Returns:
- A modified copy of the
thisobject
-
withProperties
public final ImmutablePerson withProperties(java.util.Map<java.lang.String,? extends java.lang.Object> entries)
Copy the current immutable object by replacing thepropertiesmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the properties map- Returns:
- A modified copy of
thisobject
-
withTitle
public final ImmutablePerson withTitle(java.lang.String value)
Copy the current immutable object by setting a value for thetitleattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for title (can benull)- Returns:
- A modified copy of the
thisobject
-
toString
public java.lang.String toString()
Prints the immutable valuePersonwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutablePerson copyOf(Person instance)
Creates an immutable copy of aPersonvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Person instance
-
builder
public static ImmutablePerson.Builder builder()
Creates a builder forImmutablePerson.ImmutablePerson.builder() .created(java.time.ZonedDateTime) // optionalcreated.id(String) // optionalid.updated(java.time.ZonedDateTime) // optionalupdated.age(Integer | null) // nullableage.birthdate(java.time.ZonedDateTime | null) // nullablebirthdate.comments(String | null) // nullablecomments.firstName(String) // requiredfirstName.gender(com.arakelian.faker.model.Gender | null) // nullablegender.lastName(String) // requiredlastName.putProperty|putAllProperties(String => Object) //propertiesmappings .title(String | null) // nullabletitle.build();- Returns:
- A new ImmutablePerson builder
-
-