Package org.springframework.beans.factory.config

# Class NamedBeanHolder<T>

java.lang.Object
org.springframework.beans.factory.config.NamedBeanHolder<T>

Type Parameters:
  `T` - the bean type

All Implemented Interfaces:
  `NamedBean`

public class NamedBeanHolder<T> extends Object implements NamedBean
A simple holder for a given bean name plus bean instance.

Since:
  4.3.3
Author:
  Juergen Hoeller
See Also:
  - `AutowireCapableBeanFactory.resolveNamedBean(Class)`

## Constructor Summary

Constructors
Constructor
Description
`NamedBeanHolder(String beanName, T beanInstance)`
Create a new holder for the given bean name plus instance.

## Method Summary

Modifier and Type
Method
Description
`T`
`getBeanInstance()`
Return the corresponding bean instance.
`String`
`getBeanName()`
Return the name of the bean.

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

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

## Constructor Details

### NamedBeanHolder

public NamedBeanHolder(String beanName, T beanInstance)
Create a new holder for the given bean name plus instance.

Parameters:
  `beanName` - the name of the bean
  `beanInstance` - the corresponding bean instance

## Method Details

### getBeanName

public String getBeanName()
Return the name of the bean.

Specified by:
  `getBeanName` in interface `NamedBean`

### getBeanInstance

public T getBeanInstance()
Return the corresponding bean instance.