public final class SerializableCacheKey extends Object implements GenericCacheKey<SerializableCacheKey,Serializable>, Serializable
Modifier and Type | Method and Description |
---|---|
SerializableCacheKey |
append(Iterable<Serializable> objects)
Appends the given Objects to this instance.
|
boolean |
equals(Object o) |
List<Serializable> |
getComponents()
Getter for the list of additional cache key components.
|
io.vavr.control.Option<String> |
getPrincipalId()
Getter for the name of the principal for which the key is used.
|
io.vavr.control.Option<String> |
getTenantId()
Getter for the Id of the tenant for which the key is used.
|
int |
hashCode() |
static SerializableCacheKey |
of(String tenantId,
String principalId)
Constructs a
SerializableCacheKey for the given tenant and principal identifier, independent of whether
they are null or not. |
static SerializableCacheKey |
of(Tenant tenant,
Principal principal)
Constructs a
CacheKey for the given tenant and principal identifier, independent of whether they are
null or not. |
String |
toString() |
@Nonnull public io.vavr.control.Option<String> getTenantId()
getTenantId
in interface GenericCacheKey<SerializableCacheKey,Serializable>
@Nonnull public io.vavr.control.Option<String> getPrincipalId()
getPrincipalId
in interface GenericCacheKey<SerializableCacheKey,Serializable>
@Nonnull public SerializableCacheKey append(@Nonnull Iterable<Serializable> objects) throws IllegalArgumentException
Object.equals(Object)
and
Object.hashCode()
are used. The given objects must not be null
.append
in interface GenericCacheKey<SerializableCacheKey,Serializable>
objects
- Additional objects that should be used to identify a cache key.IllegalArgumentException
- If any of the given objects is null
.@Nonnull public static SerializableCacheKey of(@Nullable String tenantId, @Nullable String principalId)
SerializableCacheKey
for the given tenant and principal identifier, independent of whether
they are null
or not. This provides the highest flexibility for defining different levels of isolation.tenantId
- The identifier of the tenant. If null
, there is not tenant isolation.principalId
- The identifier of the principal. If null
, there is no principal isolation.CacheKey
constructed from the given tenant and principal identifier.@Nonnull public static SerializableCacheKey of(@Nullable Tenant tenant, @Nullable Principal principal)
CacheKey
for the given tenant and principal identifier, independent of whether they are
null
or not. This provides the highest flexibility for defining different levels of isolation.tenant
- The tenant. If null
, there is not tenant isolation.principal
- The principal. If null
, there is no principal isolation.CacheKey
constructed from the given tenant and principal identifier.public List<Serializable> getComponents()
GenericCacheKey
getComponents
in interface GenericCacheKey<SerializableCacheKey,Serializable>
Copyright © 2019 SAP SE. All rights reserved.