Class ImmutableAddress.Builder

  • Enclosing class:
    ImmutableAddress

    @NotThreadSafe
    public static final class ImmutableAddress.Builder
    extends java.lang.Object
    Builds instances of type ImmutableAddress. 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.

    • Method Detail

      • from

        @CanIgnoreReturnValue
        public final ImmutableAddress.Builder from​(com.arakelian.store.feature.HasId instance)
        Fill a builder with attribute values from the provided com.arakelian.store.feature.HasId instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • from

        @CanIgnoreReturnValue
        public final ImmutableAddress.Builder from​(AbstractModel instance)
        Fill a builder with attribute values from the provided com.arakelian.faker.model.AbstractModel instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder 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 provided com.arakelian.store.feature.HasTimestamp instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • from

        @CanIgnoreReturnValue
        public final ImmutableAddress.Builder from​(Address instance)
        Fill a builder with attribute values from the provided com.arakelian.faker.model.Address instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • created

        @CanIgnoreReturnValue
        public final ImmutableAddress.Builder created​(java.time.ZonedDateTime created)
        Initializes the value for the created attribute.

        If not set, this attribute will have a default value as returned by the initializer of created.

        Parameters:
        created - The value for created
        Returns:
        this builder for use in a chained invocation
      • id

        @CanIgnoreReturnValue
        public final ImmutableAddress.Builder id​(java.lang.String id)
        Initializes the value for the id attribute.

        If not set, this attribute will have a default value as returned by the initializer of id.

        Parameters:
        id - The value for id
        Returns:
        this builder for use in a chained invocation
      • updated

        @CanIgnoreReturnValue
        public final ImmutableAddress.Builder updated​(java.time.ZonedDateTime updated)
        Initializes the value for the updated attribute.

        If not set, this attribute will have a default value as returned by the initializer of updated.

        Parameters:
        updated - The value for updated
        Returns:
        this builder for use in a chained invocation
      • city

        @CanIgnoreReturnValue
        public final ImmutableAddress.Builder city​(java.lang.String city)
        Initializes the value for the city attribute.
        Parameters:
        city - The value for city
        Returns:
        this builder for use in a chained invocation
      • postalCode

        @CanIgnoreReturnValue
        public final ImmutableAddress.Builder postalCode​(java.lang.String postalCode)
        Initializes the value for the postalCode attribute.
        Parameters:
        postalCode - The value for postalCode
        Returns:
        this builder for use in a chained invocation
      • state

        @CanIgnoreReturnValue
        public final ImmutableAddress.Builder state​(java.lang.String state)
        Initializes the value for the state attribute.
        Parameters:
        state - The value for state
        Returns:
        this builder for use in a chained invocation
      • street

        @CanIgnoreReturnValue
        public final ImmutableAddress.Builder street​(java.lang.String street)
        Initializes the value for the street attribute.
        Parameters:
        street - The value for street
        Returns:
        this builder for use in a chained invocation
      • build

        public ImmutableAddress build()
        Builds a new ImmutableAddress.
        Returns:
        An immutable instance of Address
        Throws:
        java.lang.IllegalStateException - if any required attributes are missing