Advertisement
Guest User

Untitled

a guest
Jul 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 KB | None | 0 0
  1. package com.kodilla.spring.portfolio;
  2.  
  3. import org.springframework.beans.factory.annotation.Qualifier;
  4. import org.springframework.context.annotation.Bean;
  5. import org.springframework.context.annotation.Configuration;
  6. import org.springframework.context.annotation.Scope;
  7.  
  8. @Configuration
  9. public class BoardConfig {
  10.  
  11.     @Bean
  12.     public Board getBoard(@Qualifier("toDo") TaskList toDo,
  13.                           @Qualifier("inProgress") TaskList inProgress,
  14.                           @Qualifier("done") TaskList done) {
  15.         return new Board(toDo, inProgress, done);
  16.     }
  17.  
  18.     @Bean(name = "toDo")
  19.     @Scope("prototype")
  20.     public TaskList getToDoList() {
  21.         return new TaskList();
  22.     }
  23.  
  24.     @Bean(name = "inProgress")
  25.     @Scope("prototype")
  26.     public TaskList getInProgressList() {
  27.         return new TaskList();
  28.     }
  29.  
  30.     @Bean(name = "done")
  31.     @Scope("prototype")
  32.     public TaskList getDoneList() {
  33.         return new TaskList();
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement