Package io.dialob.security.tenant
Class ImmutableTenant
- java.lang.Object
-
- io.dialob.security.tenant.ImmutableTenant
-
- All Implemented Interfaces:
Tenant,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableTenant extends Object implements Tenant
Immutable implementation ofTenant.Use the builder to create immutable instances:
ImmutableTenant.builder(). Use the static factory method to create immutable instances:ImmutableTenant.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTenant.BuilderBuilds instances of typeImmutableTenant.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTenant.Builderbuilder()Creates a builder forImmutableTenant.static ImmutableTenantcopyOf(Tenant instance)Creates an immutable copy of aTenantvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableTenantthat have equal attribute values.StringgetId()Optional<String>getName()inthashCode()Computes a hash code from attributes:id,name.static ImmutableTenantof(String id, Optional<String> name)Construct a new immutableTenantinstance.StringtoString()Prints the immutable valueTenantwith attribute values.ImmutableTenantwithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableTenantwithName(String value)Copy the current immutable object by setting a present value for the optionalnameattribute.ImmutableTenantwithName(Optional<String> optional)Copy the current immutable object by setting an optional value for thenameattribute.
-
-
-
Method Detail
-
getId
public String getId()
-
withId
public final ImmutableTenant withId(String value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withName
public final ImmutableTenant withName(String value)
Copy the current immutable object by setting a present value for the optionalnameattribute.- Parameters:
value- The value for name- Returns:
- A modified copy of
thisobject
-
withName
public final ImmutableTenant withName(Optional<String> optional)
Copy the current immutable object by setting an optional value for thenameattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for name- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableTenantthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,name.
-
toString
public String toString()
Prints the immutable valueTenantwith attribute values.
-
of
public static ImmutableTenant of(String id, Optional<String> name)
Construct a new immutableTenantinstance.- Parameters:
id- The value for theidattributename- The value for thenameattribute- Returns:
- An immutable Tenant instance
-
copyOf
public static ImmutableTenant copyOf(Tenant instance)
Creates an immutable copy of aTenantvalue. 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 forImmutableTenant.ImmutableTenant.builder() .id(String) // requiredid.name(String) // optionalname.build();- Returns:
- A new ImmutableTenant builder
-
-