Class ImmutableDatabaseMeta

java.lang.Object
org.nuiton.db.meta.ImmutableDatabaseMeta
All Implemented Interfaces:
DatabaseMeta

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

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

  • Method Details

    • getSchema

      public String getSchema()
      Specified by:
      getSchema in interface DatabaseMeta
      Returns:
      The value of the schema attribute
    • getCustomTypes

      public com.google.common.collect.ImmutableList<CustomTypeMeta> getCustomTypes()
      Specified by:
      getCustomTypes in interface DatabaseMeta
      Returns:
      The value of the customTypes attribute
    • getTables

      public com.google.common.collect.ImmutableList<TableMeta> getTables()
      Specified by:
      getTables in interface DatabaseMeta
      Returns:
      The value of the tables attribute
    • getViews

      public com.google.common.collect.ImmutableList<TableMeta> getViews()
      Specified by:
      getViews in interface DatabaseMeta
      Returns:
      The value of the views attribute
    • getProcedures

      public com.google.common.collect.ImmutableList<ProcedureMeta> getProcedures()
      Specified by:
      getProcedures in interface DatabaseMeta
      Returns:
      The value of the procedures attribute
    • withSchema

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

      public final ImmutableDatabaseMeta withCustomTypes(CustomTypeMeta... elements)
      Copy the current immutable object with elements that replace the content of customTypes.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withCustomTypes

      public final ImmutableDatabaseMeta withCustomTypes(Iterable<? extends CustomTypeMeta> elements)
      Copy the current immutable object with elements that replace the content of customTypes. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of customTypes elements to set
      Returns:
      A modified copy or this if not changed
    • withTables

      public final ImmutableDatabaseMeta withTables(TableMeta... elements)
      Copy the current immutable object with elements that replace the content of tables.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withTables

      public final ImmutableDatabaseMeta withTables(Iterable<? extends TableMeta> elements)
      Copy the current immutable object with elements that replace the content of tables. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of tables elements to set
      Returns:
      A modified copy or this if not changed
    • withViews

      public final ImmutableDatabaseMeta withViews(TableMeta... elements)
      Copy the current immutable object with elements that replace the content of views.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withViews

      public final ImmutableDatabaseMeta withViews(Iterable<? extends TableMeta> elements)
      Copy the current immutable object with elements that replace the content of views. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of views elements to set
      Returns:
      A modified copy or this if not changed
    • withProcedures

      public final ImmutableDatabaseMeta withProcedures(ProcedureMeta... elements)
      Copy the current immutable object with elements that replace the content of procedures.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withProcedures

      public final ImmutableDatabaseMeta withProcedures(Iterable<? extends ProcedureMeta> elements)
      Copy the current immutable object with elements that replace the content of procedures. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of procedures elements to set
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableDatabaseMeta 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: schema, customTypes, tables, views, procedures.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableDatabaseMeta.Builder builder()
      Creates a builder for ImmutableDatabaseMeta.
      ImmutableDatabaseMeta.builder()
         .schema(String) // required schema
         .addCustomTypes|addAllCustomTypes(org.nuiton.db.meta.CustomTypeMeta) // customTypes elements
         .addTables|addAllTables(org.nuiton.db.meta.TableMeta) // tables elements
         .addViews|addAllViews(org.nuiton.db.meta.TableMeta) // views elements
         .addProcedures|addAllProcedures(org.nuiton.db.meta.ProcedureMeta) // procedures elements
         .build();
      
      Returns:
      A new ImmutableDatabaseMeta builder