Package org.springframework.beans.factory.support

# Record Class RegisteredBean.InstantiationDescriptor

java.lang.Object
java.lang.Record
org.springframework.beans.factory.support.RegisteredBean.InstantiationDescriptor

Record Components:
  `executable` - the `Executable` (`Constructor` or `Method`) to invoke
  `targetClass` - the target `Class` of the executable

Enclosing class:
  RegisteredBean

public static record RegisteredBean.InstantiationDescriptor(Executable executable, Class<?> targetClass) extends Record
Descriptor for how a bean should be instantiated. While the `targetClass` is usually the declaring class of the `executable` (in case of a constructor or a locally declared factory method), there are cases where retaining the actual concrete class is necessary (for example, for an inherited factory method).

Since:
  6.1.7

## Constructor Summary

Constructors
Constructor
Description
`InstantiationDescriptor(Executable executable)`
`InstantiationDescriptor(Executable executable, Class<?> targetClass)`
Creates an instance of a `InstantiationDescriptor` record class.

## Method Summary

Modifier and Type
Method
Description
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`Executable`
`executable()`
Returns the value of the `executable` record component.
`final int`
`hashCode()`
Returns a hash code value for this object.
`Class<?>`
`targetClass()`
Returns the value of the `targetClass` record component.
`final String`
`toString()`
Returns a string representation of this record class.

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

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

## Constructor Details

### InstantiationDescriptor

public InstantiationDescriptor(Executable executable)

### InstantiationDescriptor

public InstantiationDescriptor(Executable executable, Class<?> targetClass)
Creates an instance of a `InstantiationDescriptor` record class.

Parameters:
  `executable` - the value for the `executable` record component
  `targetClass` - the value for the `targetClass` record component

## Method Details

### toString

public final String toString()
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.

Specified by:
  `toString` in class `Record`
Returns:
  a string representation of this object

### hashCode

public final int hashCode()
Returns a hash code value for this object. The value is derived from the hash code of each of the record components.

Specified by:
  `hashCode` in class `Record`
Returns:
  a hash code value for this object

### equals

public final boolean equals(Object o)
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with `Objects::equals(Object,Object)`.

Specified by:
  `equals` in class `Record`
Parameters:
  `o` - the object with which to compare
Returns:
  `true` if this object is the same as the `o` argument; `false` otherwise.

### executable

public Executable executable()
Returns the value of the `executable` record component.

Returns:
  the value of the `executable` record component

### targetClass

public Class<?> targetClass()
Returns the value of the `targetClass` record component.

Returns:
  the value of the `targetClass` record component