title: Is it possible to set a bean name using annotations in Spring Framework?
body: <p>I have a bean like this:</p>
  
  <pre><code>@Bean
  public String myBean(){
      return "My bean";
  }
  </code></pre>
  
  <p>I want to autowire it:</p>
  
  <pre><code>@Autowired
  @Qualifier("myBean")
  public void setMyBean(String myBean){
      this.myBean=myBean;
  }
  </code></pre>
  
  <p>I need something like:</p>
  
  <pre><code>@Bean(name="myCustomBean")
  </code></pre>
  
  <p>Is it possible to use custom names names for beans out of the box? If it isn't possible out of the box then how to create such a bean?</p>