Package org.springframework.core

# Class MethodClassKey

java.lang.Object
org.springframework.core.MethodClassKey

All Implemented Interfaces:
  `Comparable<MethodClassKey>`

public final class MethodClassKey extends Object implements Comparable<MethodClassKey>
A common key class for a method against a specific target class, including `toString()` representation and `Comparable` support (as suggested for custom `HashMap` keys as of Java 8).

Since:
  4.3
Author:
  Juergen Hoeller

## Constructor Summary

Constructors
Constructor
Description
`MethodClassKey(Method method, Class<?> targetClass)`
Create a key object for the given method and target class.

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(MethodClassKey other)`
`boolean`
`equals(Object other)`
`int`
`hashCode()`
`String`
`toString()`

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### MethodClassKey

public MethodClassKey(Method method, @Nullable Class<?> targetClass)
Create a key object for the given method and target class.

Parameters:
  `method` - the method to wrap (must not be `null`)
  `targetClass` - the target class that the method will be invoked on (may be `null` if identical to the declaring class)

## Method Details

### equals

public boolean equals(@Nullable Object other)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### compareTo

public int compareTo(MethodClassKey other)

Specified by:
  `compareTo` in interface `Comparable<MethodClassKey>`