com.liferay.portal.kernel.util
Class MethodKey
java.lang.Object
com.liferay.portal.kernel.util.MethodKey
- All Implemented Interfaces:
- Externalizable, Serializable
public class MethodKey
- extends Object
- implements Externalizable
Provides a serializable loose representation for Method, considering
the declaring class, name, and parameter types of the Method, while
ignoring its return type and exceptions. This means the compiler generated
bridging method is considered logically the same as it source counterpart. On
deserialization for a generic Method, the Method that is
resolved (bridge method or source method) is runtime environment dependent.
Whether it is resolved to a bridge method or source method is of no
consequence, as a force cast is performed on the method's return value,
assuring the same result.
- See Also:
- Serialized Form
MethodKey
public MethodKey()
- The empty constructor is required by
Externalizable. Do not use
this for any other purpose.
MethodKey
public MethodKey(Class<?> declaringClass,
String methodName,
Class<?>... parameterTypes)
MethodKey
public MethodKey(Method method)
MethodKey
@Deprecated
public MethodKey(String declaringClassName,
String methodName,
Class<?>... parameterTypes)
- Deprecated. As of 6.2.0, replaced by
MethodKey(Class, String,
Class...)
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
getDeclaringClass
public Class<?> getDeclaringClass()
getMethod
public Method getMethod()
throws NoSuchMethodException
- Throws:
NoSuchMethodException
getMethodName
public String getMethodName()
getParameterTypes
public Class<?>[] getParameterTypes()
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
readExternal
public void readExternal(ObjectInput objectInput)
throws ClassNotFoundException,
IOException
- Specified by:
readExternal in interface Externalizable
- Throws:
ClassNotFoundException
IOException
toString
public String toString()
- Overrides:
toString in class Object
transform
public MethodKey transform(ClassLoader classLoader)
throws ClassNotFoundException
- Throws:
ClassNotFoundException
writeExternal
public void writeExternal(ObjectOutput objectOutput)
throws IOException
- Specified by:
writeExternal in interface Externalizable
- Throws:
IOException