Package io.dialob.security.key
Class ImmutableApiKey
- java.lang.Object
-
- io.dialob.security.key.ImmutableApiKey
-
- All Implemented Interfaces:
ApiKey,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableApiKey extends Object implements ApiKey
Immutable implementation ofApiKey.Use the builder to create immutable instances:
ImmutableApiKey.builder(). Use the static factory method to create immutable instances:ImmutableApiKey.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableApiKey.BuilderBuilds instances of typeImmutableApiKey.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableApiKey.Builderbuilder()Creates a builder forImmutableApiKey.static ImmutableApiKeycopyOf(ApiKey instance)Creates an immutable copy of aApiKeyvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableApiKeythat have equal attribute values.StringgetClientId()Optional<LocalDateTime>getCreated()Optional<LocalDateTime>getEndDateTime()Optional<String>getHash()Optional<String>getOwner()Optional<LocalDateTime>getStartDateTime()Optional<String>getTenantId()Optional<String>getToken()inthashCode()Computes a hash code from attributes:clientId,token,hash,tenantId,owner,created,startDateTime,endDateTime.static ImmutableApiKeyof(String clientId)Construct a new immutableApiKeyinstance.StringtoString()Prints the immutable valueApiKeywith attribute values.ImmutableApiKeywithClientId(String value)Copy the current immutable object by setting a value for theclientIdattribute.ImmutableApiKeywithCreated(LocalDateTime value)Copy the current immutable object by setting a present value for the optionalcreatedattribute.ImmutableApiKeywithCreated(Optional<? extends LocalDateTime> optional)Copy the current immutable object by setting an optional value for thecreatedattribute.ImmutableApiKeywithEndDateTime(LocalDateTime value)Copy the current immutable object by setting a present value for the optionalendDateTimeattribute.ImmutableApiKeywithEndDateTime(Optional<? extends LocalDateTime> optional)Copy the current immutable object by setting an optional value for theendDateTimeattribute.ImmutableApiKeywithHash(String value)Copy the current immutable object by setting a present value for the optionalhashattribute.ImmutableApiKeywithHash(Optional<String> optional)Copy the current immutable object by setting an optional value for thehashattribute.ImmutableApiKeywithOwner(String value)Copy the current immutable object by setting a present value for the optionalownerattribute.ImmutableApiKeywithOwner(Optional<String> optional)Copy the current immutable object by setting an optional value for theownerattribute.ImmutableApiKeywithStartDateTime(LocalDateTime value)Copy the current immutable object by setting a present value for the optionalstartDateTimeattribute.ImmutableApiKeywithStartDateTime(Optional<? extends LocalDateTime> optional)Copy the current immutable object by setting an optional value for thestartDateTimeattribute.ImmutableApiKeywithTenantId(String value)Copy the current immutable object by setting a present value for the optionaltenantIdattribute.ImmutableApiKeywithTenantId(Optional<String> optional)Copy the current immutable object by setting an optional value for thetenantIdattribute.ImmutableApiKeywithToken(String value)Copy the current immutable object by setting a present value for the optionaltokenattribute.ImmutableApiKeywithToken(Optional<String> optional)Copy the current immutable object by setting an optional value for thetokenattribute.
-
-
-
Method Detail
-
getClientId
public String getClientId()
- Specified by:
getClientIdin interfaceApiKey- Returns:
- The value of the
clientIdattribute
-
getTenantId
public Optional<String> getTenantId()
- Specified by:
getTenantIdin interfaceApiKey- Returns:
- The value of the
tenantIdattribute
-
getCreated
public Optional<LocalDateTime> getCreated()
- Specified by:
getCreatedin interfaceApiKey- Returns:
- The value of the
createdattribute
-
getStartDateTime
public Optional<LocalDateTime> getStartDateTime()
- Specified by:
getStartDateTimein interfaceApiKey- Returns:
- The value of the
startDateTimeattribute
-
getEndDateTime
public Optional<LocalDateTime> getEndDateTime()
- Specified by:
getEndDateTimein interfaceApiKey- Returns:
- The value of the
endDateTimeattribute
-
withClientId
public final ImmutableApiKey withClientId(String value)
Copy the current immutable object by setting a value for theclientIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for clientId- Returns:
- A modified copy of the
thisobject
-
withToken
public final ImmutableApiKey withToken(String value)
Copy the current immutable object by setting a present value for the optionaltokenattribute.- Parameters:
value- The value for token- Returns:
- A modified copy of
thisobject
-
withToken
public final ImmutableApiKey withToken(Optional<String> optional)
Copy the current immutable object by setting an optional value for thetokenattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for token- Returns:
- A modified copy of
thisobject
-
withHash
public final ImmutableApiKey withHash(String value)
Copy the current immutable object by setting a present value for the optionalhashattribute.- Parameters:
value- The value for hash- Returns:
- A modified copy of
thisobject
-
withHash
public final ImmutableApiKey withHash(Optional<String> optional)
Copy the current immutable object by setting an optional value for thehashattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for hash- Returns:
- A modified copy of
thisobject
-
withTenantId
public final ImmutableApiKey withTenantId(String value)
Copy the current immutable object by setting a present value for the optionaltenantIdattribute.- Parameters:
value- The value for tenantId- Returns:
- A modified copy of
thisobject
-
withTenantId
public final ImmutableApiKey withTenantId(Optional<String> optional)
Copy the current immutable object by setting an optional value for thetenantIdattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for tenantId- Returns:
- A modified copy of
thisobject
-
withOwner
public final ImmutableApiKey withOwner(String value)
Copy the current immutable object by setting a present value for the optionalownerattribute.- Parameters:
value- The value for owner- Returns:
- A modified copy of
thisobject
-
withOwner
public final ImmutableApiKey withOwner(Optional<String> optional)
Copy the current immutable object by setting an optional value for theownerattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for owner- Returns:
- A modified copy of
thisobject
-
withCreated
public final ImmutableApiKey withCreated(LocalDateTime value)
Copy the current immutable object by setting a present value for the optionalcreatedattribute.- Parameters:
value- The value for created- Returns:
- A modified copy of
thisobject
-
withCreated
public final ImmutableApiKey withCreated(Optional<? extends LocalDateTime> optional)
Copy the current immutable object by setting an optional value for thecreatedattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for created- Returns:
- A modified copy of
thisobject
-
withStartDateTime
public final ImmutableApiKey withStartDateTime(LocalDateTime value)
Copy the current immutable object by setting a present value for the optionalstartDateTimeattribute.- Parameters:
value- The value for startDateTime- Returns:
- A modified copy of
thisobject
-
withStartDateTime
public final ImmutableApiKey withStartDateTime(Optional<? extends LocalDateTime> optional)
Copy the current immutable object by setting an optional value for thestartDateTimeattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for startDateTime- Returns:
- A modified copy of
thisobject
-
withEndDateTime
public final ImmutableApiKey withEndDateTime(LocalDateTime value)
Copy the current immutable object by setting a present value for the optionalendDateTimeattribute.- Parameters:
value- The value for endDateTime- Returns:
- A modified copy of
thisobject
-
withEndDateTime
public final ImmutableApiKey withEndDateTime(Optional<? extends LocalDateTime> optional)
Copy the current immutable object by setting an optional value for theendDateTimeattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for endDateTime- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableApiKeythat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:clientId,token,hash,tenantId,owner,created,startDateTime,endDateTime.
-
toString
public String toString()
Prints the immutable valueApiKeywith attribute values.
-
of
public static ImmutableApiKey of(String clientId)
Construct a new immutableApiKeyinstance.- Parameters:
clientId- The value for theclientIdattribute- Returns:
- An immutable ApiKey instance
-
copyOf
public static ImmutableApiKey copyOf(ApiKey instance)
Creates an immutable copy of aApiKeyvalue. 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 ApiKey instance
-
builder
public static ImmutableApiKey.Builder builder()
Creates a builder forImmutableApiKey.ImmutableApiKey.builder() .clientId(String) // requiredclientId.token(String) // optionaltoken.hash(String) // optionalhash.tenantId(String) // optionaltenantId.owner(String) // optionalowner.created(java.time.LocalDateTime) // optionalcreated.startDateTime(java.time.LocalDateTime) // optionalstartDateTime.endDateTime(java.time.LocalDateTime) // optionalendDateTime.build();- Returns:
- A new ImmutableApiKey builder
-
-