Class 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 Person
    Immutable implementation of Person.

    Use the builder to create immutable instances: ImmutablePerson.builder().

    See Also:
    Serialized Form
    • Method Detail

      • getCreated

        public java.time.ZonedDateTime getCreated()
        Specified by:
        getCreated in interface com.arakelian.store.feature.HasTimestamp
        Overrides:
        getCreated in class AbstractModel
        Returns:
        The value of the created attribute
      • getId

        public java.lang.String getId()
        Specified by:
        getId in interface com.arakelian.store.feature.HasId
        Overrides:
        getId in class AbstractModel
        Returns:
        The value of the id attribute
      • getUpdated

        public java.time.ZonedDateTime getUpdated()
        Specified by:
        getUpdated in interface com.arakelian.store.feature.HasTimestamp
        Overrides:
        getUpdated in class AbstractModel
        Returns:
        The value of the updated attribute
      • getAge

        public java.lang.Integer getAge()
        Overrides:
        getAge in class Person
        Returns:
        The value of the age attribute
      • getBirthdate

        public java.time.ZonedDateTime getBirthdate()
        Specified by:
        getBirthdate in class Person
        Returns:
        The value of the birthdate attribute
      • getComments

        public java.lang.String getComments()
        Specified by:
        getComments in class Person
        Returns:
        The value of the comments attribute
      • getFirstName

        public java.lang.String getFirstName()
        Specified by:
        getFirstName in class Person
        Returns:
        The value of the firstName attribute
      • getGender

        public Gender getGender()
        Specified by:
        getGender in class Person
        Returns:
        The value of the gender attribute
      • getLastName

        public java.lang.String getLastName()
        Specified by:
        getLastName in class Person
        Returns:
        The value of the lastName attribute
      • getProperties

        public com.google.common.collect.ImmutableMap<java.lang.String,​java.lang.Object> getProperties()
        Overrides:
        getProperties in class Person
        Returns:
        The value of the properties attribute
      • getTitle

        public java.lang.String getTitle()
        Specified by:
        getTitle in class Person
        Returns:
        The value of the title attribute
      • withCreated

        public final ImmutablePerson withCreated​(java.time.ZonedDateTime value)
        Copy the current immutable object by setting a value for the created attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for created
        Returns:
        A modified copy of the this object
      • withId

        public final ImmutablePerson withId​(java.lang.String value)
        Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for id
        Returns:
        A modified copy of the this object
      • withUpdated

        public final ImmutablePerson withUpdated​(java.time.ZonedDateTime value)
        Copy the current immutable object by setting a value for the updated attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for updated
        Returns:
        A modified copy of the this object
      • withAge

        public final ImmutablePerson withAge​(java.lang.Integer value)
        Copy the current immutable object by setting a value for the age attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for age (can be null)
        Returns:
        A modified copy of the this object
      • withBirthdate

        public final ImmutablePerson withBirthdate​(java.time.ZonedDateTime value)
        Copy the current immutable object by setting a value for the birthdate attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for birthdate (can be null)
        Returns:
        A modified copy of the this object
      • withComments

        public final ImmutablePerson withComments​(java.lang.String value)
        Copy the current immutable object by setting a value for the comments attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for comments (can be null)
        Returns:
        A modified copy of the this object
      • withFirstName

        public final ImmutablePerson withFirstName​(java.lang.String value)
        Copy the current immutable object by setting a value for the firstName attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for firstName
        Returns:
        A modified copy of the this object
      • withGender

        public final ImmutablePerson withGender​(Gender value)
        Copy the current immutable object by setting a value for the gender attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for gender (can be null)
        Returns:
        A modified copy of the this object
      • withLastName

        public final ImmutablePerson withLastName​(java.lang.String value)
        Copy the current immutable object by setting a value for the lastName attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for lastName
        Returns:
        A modified copy of the this object
      • withProperties

        public final ImmutablePerson withProperties​(java.util.Map<java.lang.String,​? extends java.lang.Object> entries)
        Copy the current immutable object by replacing the properties map 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 returning this.
        Parameters:
        entries - The entries to be added to the properties map
        Returns:
        A modified copy of this object
      • withTitle

        public final ImmutablePerson withTitle​(java.lang.String value)
        Copy the current immutable object by setting a value for the title attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for title (can be null)
        Returns:
        A modified copy of the this object
      • toString

        public java.lang.String toString()
        Prints the immutable value Person with attribute values.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutablePerson copyOf​(Person instance)
        Creates an immutable copy of a Person value. 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 for ImmutablePerson.
         ImmutablePerson.builder()
            .created(java.time.ZonedDateTime) // optional created
            .id(String) // optional id
            .updated(java.time.ZonedDateTime) // optional updated
            .age(Integer | null) // nullable age
            .birthdate(java.time.ZonedDateTime | null) // nullable birthdate
            .comments(String | null) // nullable comments
            .firstName(String) // required firstName
            .gender(com.arakelian.faker.model.Gender | null) // nullable gender
            .lastName(String) // required lastName
            .putProperty|putAllProperties(String => Object) // properties mappings
            .title(String | null) // nullable title
            .build();
         
        Returns:
        A new ImmutablePerson builder