Class ImmutableColumnRef

java.lang.Object
org.nuiton.db.meta.ImmutableColumnRef
All Implemented Interfaces:
ColumnRef

@Generated(from="ColumnRef", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableColumnRef extends Object implements ColumnRef
Immutable implementation of ColumnRef.

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

  • Method Details

    • getTable

      public String getTable()
      Specified by:
      getTable in interface ColumnRef
      Returns:
      The value of the table attribute
    • getColumn

      public Optional<String> getColumn()
      Specified by:
      getColumn in interface ColumnRef
      Returns:
      The value of the column attribute
    • withTable

      public final ImmutableColumnRef withTable(String value)
      Copy the current immutable object by setting a value for the table attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for table
      Returns:
      A modified copy or the this object
    • withColumn

      public final ImmutableColumnRef withColumn(String value)
      Copy the current immutable object by setting a present value for the optional column attribute.
      Parameters:
      value - The value for column
      Returns:
      A modified copy or this if not changed
    • withColumn

      public final ImmutableColumnRef withColumn(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the column attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for column
      Returns:
      A modified copy or this if not changed
    • equals

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

      public int hashCode()
      Computes a hash code from attributes: table, column.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableColumnRef copyOf(ColumnRef instance)
      Creates an immutable copy of a ColumnRef 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 ColumnRef instance
    • builder

      public static ImmutableColumnRef.Builder builder()
      Creates a builder for ImmutableColumnRef.
      ImmutableColumnRef.builder()
         .table(String) // required table
         .column(Optional<String>) // optional column
         .build();
      
      Returns:
      A new ImmutableColumnRef builder