Package org.springframework.cache.interceptor

# Class CacheAspectSupport.CacheOperationContext

java.lang.Object
org.springframework.cache.interceptor.CacheAspectSupport.CacheOperationContext

All Implemented Interfaces:
  `CacheOperationInvocationContext<CacheOperation>`

Enclosing class:
  CacheAspectSupport

protected class CacheAspectSupport.CacheOperationContext extends Object implements CacheOperationInvocationContext<CacheOperation>
A `CacheOperationInvocationContext` context for a `CacheOperation`.

## Constructor Summary

Constructors
Constructor
Description
`CacheOperationContext(CacheAspectSupport.CacheOperationMetadata metadata, Object[] args, Object target)`

## Method Summary

Modifier and Type
Method
Description
`protected boolean`
`canPutToCache(Object value)`
`protected Object`
`generateKey(Object result)`
Compute the key for the given caching operation.
`Object[]`
`getArgs()`
Return the argument list used to invoke the method.
`protected Collection<String>`
`getCacheNames()`
`protected Collection<? extends Cache>`
`getCaches()`
`protected Object`
`getGeneratedKey()`
Get generated key.
`Method`
`getMethod()`
Return the method which was invoked.
`CacheOperation`
`getOperation()`
Return the cache operation.
`Object`
`getTarget()`
Return the target instance on which the method was invoked.
`protected boolean`
`isConditionPassing(Object result)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CacheOperationContext

public CacheOperationContext(CacheAspectSupport.CacheOperationMetadata metadata, Object[] args, Object target)

## Method Details

### getOperation

public CacheOperation getOperation()
Description copied from interface: `CacheOperationInvocationContext`
Return the cache operation.

Specified by:
  `getOperation` in interface `CacheOperationInvocationContext<CacheOperation>`

### getTarget

public Object getTarget()
Description copied from interface: `CacheOperationInvocationContext`
Return the target instance on which the method was invoked.

Specified by:
  `getTarget` in interface `CacheOperationInvocationContext<CacheOperation>`

### getMethod

public Method getMethod()
Description copied from interface: `CacheOperationInvocationContext`
Return the method which was invoked.

Specified by:
  `getMethod` in interface `CacheOperationInvocationContext<CacheOperation>`

### getArgs

public Object[] getArgs()
Description copied from interface: `CacheOperationInvocationContext`
Return the argument list used to invoke the method.

Specified by:
  `getArgs` in interface `CacheOperationInvocationContext<CacheOperation>`

### isConditionPassing

protected boolean isConditionPassing(@Nullable Object result)

### canPutToCache

protected boolean canPutToCache(@Nullable Object value)

### generateKey

@Nullable protected Object generateKey(@Nullable Object result)
Compute the key for the given caching operation.

### getGeneratedKey

@Nullable protected Object getGeneratedKey()
Get generated key.

Returns:
  generated key
Since:
  6.1.2

### getCaches

protected Collection<? extends Cache> getCaches()

### getCacheNames

protected Collection<String> getCacheNames()