Class ImmutableTenant

java.lang.Object
io.resys.thena.api.entities.ImmutableTenant
All Implemented Interfaces:
Tenant, TenantEntity

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

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

  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in interface Tenant
      Returns:
      The value of the id attribute
    • getRev

      public String getRev()
      Specified by:
      getRev in interface Tenant
      Returns:
      The value of the rev attribute
    • getPrefix

      public String getPrefix()
      Specified by:
      getPrefix in interface Tenant
      Returns:
      The value of the prefix attribute
    • getName

      public String getName()
      Specified by:
      getName in interface Tenant
      Returns:
      The value of the name attribute
    • getExternalId

      @Nullable public String getExternalId()
      Specified by:
      getExternalId in interface Tenant
      Returns:
      The value of the externalId attribute
    • getType

      public Tenant.StructureType getType()
      Specified by:
      getType in interface Tenant
      Returns:
      The value of the type attribute
    • withId

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

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

      public final ImmutableTenant 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
    • withName

      public final ImmutableTenant withName(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 or the this object
    • withExternalId

      public final ImmutableTenant withExternalId(@Nullable String value)
      Copy the current immutable object by setting a value for the externalId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for externalId (can be null)
      Returns:
      A modified copy or the this object
    • withType

      public final ImmutableTenant withType(Tenant.StructureType 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 or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableTenant 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: id, rev, prefix, name, externalId, type.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableTenant.Builder builder()
      Creates a builder for ImmutableTenant.
       ImmutableTenant.builder()
          .id(String) // required id
          .rev(String) // required rev
          .prefix(String) // required prefix
          .name(String) // required name
          .externalId(String | null) // nullable externalId
          .type(io.resys.thena.api.entities.Tenant.StructureType) // required type
          .build();
       
      Returns:
      A new ImmutableTenant builder