Interface GenericCacheKey<ClassT,ComponentT>

Type Parameters:
ClassT - The type of the actual implementation.
ComponentT - The type of the appended component data.
All Known Implementing Classes:
CacheKey, SerializableCacheKey

public interface GenericCacheKey<ClassT,ComponentT>
GenericCacheKey interface for providing access to tenant and principal data, as well as a list of appended components.
  • Method Summary

    Modifier and Type
    Method
    Description
    Appends the given Objects to this instance.
    Getter for the list of additional cache key components.
    io.vavr.control.Option<String>
    Getter for the name of the principal for which the key is used.
    io.vavr.control.Option<String>
    Getter for the Id of the tenant for which the key is used.
  • Method Details

    • getComponents

      @Nonnull List<ComponentT> getComponents()
      Getter for the list of additional cache key components.
      Returns:
      The list of additional cache key components.
    • getTenantId

      @Nonnull io.vavr.control.Option<String> getTenantId()
      Getter for the Id of the tenant for which the key is used.
      Returns:
      The tenant identifier.
    • getPrincipalId

      @Nonnull io.vavr.control.Option<String> getPrincipalId()
      Getter for the name of the principal for which the key is used.
      Returns:
      The principal identifier.
    • append

      @Nonnull ClassT append(@Nonnull Iterable<ComponentT> objects) throws IllegalArgumentException
      Appends the given Objects to this instance. In order to compare cache keys, Object.equals(Object) and Object.hashCode() are used. The given objects must not be null.
      Parameters:
      objects - Additional objects that should be used to identify a cache key.
      Returns:
      This instance with the objects added.
      Throws:
      IllegalArgumentException - If any of the given objects is null.