Class ImmutableColumn

  • All Implemented Interfaces:
    TextReader.Column

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableColumn
    extends java.lang.Object
    implements TextReader.Column
    Immutable implementation of TextReader.Column.

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

    • Method Detail

      • getLength

        public int getLength()
        Specified by:
        getLength in interface TextReader.Column
        Returns:
        The value of the length attribute
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface TextReader.Column
        Returns:
        The value of the name attribute
      • withLength

        public final ImmutableColumn withLength​(int value)
        Copy the current immutable object by setting a value for the length attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for length
        Returns:
        A modified copy of the this object
      • withName

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

        public final ImmutableColumn withType​(TextReader.Type value)
        Copy the current immutable object by setting a value for the type attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for type
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableColumn that have equal attribute values.
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: length, name, type.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableColumn copyOf​(TextReader.Column instance)
        Creates an immutable copy of a TextReader.Column 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 Column instance
      • builder

        public static ImmutableColumn.Builder builder()
        Creates a builder for ImmutableColumn.
         ImmutableColumn.builder()
            .length(int) // optional length
            .name(String) // required name
            .type(com.arakelian.faker.reader.TextReader.Type) // optional type
            .build();
         
        Returns:
        A new ImmutableColumn builder