Interface CacheResultPostProcessor

All Superinterfaces:
org.springframework.core.Ordered

public interface CacheResultPostProcessor extends org.springframework.core.Ordered
Implementations can post process results returned from the cache before they are returned from the call to CacheStateManager.computeIfAbsent(Supplier, CacheInfo) or CacheStateManager.computeIfAbsent(Function, ImperativeListCacheInfo). This is commonly used to apply additional handling, like sorting.
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
     
    <P> P
    post(P result, boolean isImperativeProcessing)
    Post process the result.
  • Method Details

    • post

      <P> P post(P result, boolean isImperativeProcessing)
      Post process the result.
      Type Parameters:
      P - The result type
      Parameters:
      result - The input to process
      isImperativeProcessing - Whether or not this post process is the result of an imperative based cache call. See CacheStateManager.computeIfAbsent(Function, ImperativeListCacheInfo).
      Returns:
      The processed result
    • getOrder

      default int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered