Package com.easydesk.cache.impl
Class MethodInvocationCacheKey
java.lang.Object
com.easydesk.cache.impl.MethodInvocationCacheKey
- All Implemented Interfaces:
Serializable
An immutable cache key representing a single method invocation: the target
instance (or, for a static method, a String identifying the class), the
method name, and the arguments the method was called with.
- Version:
- $Id: MethodInvocationCacheKey.java 1 2024-06-10 00:00:00Z youngho.cho $
- Author:
- ">Youngho Cho
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMethodInvocationCacheKey(Serializable instanceOrClass, String method, Serializable... args) Creates a cache key for a method call. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()booleansameInstance(Serializable instanceOrClass) Returns true if this key was created for a method invocation on the given instance (or class name, for static methods).toString()
-
Constructor Details
-
MethodInvocationCacheKey
Creates a cache key for a method call.- Parameters:
instanceOrClass- the object on which the method is invoked; if the method is static, a String naming the class is typically used insteadmethod- the method nameargs- the method arguments, may be empty
-
-
Method Details
-
sameInstance
Returns true if this key was created for a method invocation on the given instance (or class name, for static methods).- Parameters:
instanceOrClass- the instance or class name to compare against- Returns:
- true if this key is for a method invocation on that instance/class
-
equals
-
hashCode
public int hashCode() -
toString
-