Class ImmutableTenantContext

java.lang.Object
io.resys.thena.datasource.TenantContext
io.resys.thena.datasource.ImmutableTenantContext

@Generated(from="TenantContext", generator="Immutables") @Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableTenantContext extends TenantContext
Immutable implementation of TenantContext.

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

  • Method Details

    • getDb

      public String getDb()
      Specified by:
      getDb in class TenantContext
      Returns:
      The value of the db attribute
    • getTenant

      public String getTenant()
      Specified by:
      getTenant in class TenantContext
      Returns:
      The value of the tenant attribute
    • getPrefix

      public String getPrefix()
      Specified by:
      getPrefix in class TenantContext
      Returns:
      The value of the prefix attribute
    • withDb

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

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

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

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableTenantContext 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: db, tenant, prefix.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableTenantContext.Builder builder()
      Creates a builder for ImmutableTenantContext.
       ImmutableTenantContext.builder()
          .db(String) // required db
          .tenant(String) // required tenant
          .prefix(String) // required prefix
          .build();
       
      Returns:
      A new ImmutableTenantContext builder