Revert "BAEL-812: List of Rules Engines in Java (#2319)" (#2455)

This reverts commit dc105bc6f2.
This commit is contained in:
adamd1985
2017-08-20 15:44:20 +02:00
committed by GitHub
parent b7ad275bdd
commit e6c2fd3bbe
16 changed files with 0 additions and 337 deletions
@@ -1,70 +0,0 @@
package com.baeldung.autowired;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
@SpringBootApplication
public class TypesOfBeanInjectionSpring {
private final UserService userService;
@Autowired // the @Autowired can even be omitted, in case there's only one explicit constructor
public TypesOfBeanInjectionSpring(UserService userService) {
this.userService = userService;
}
public static void main(String[] args) {
SpringApplication.run(TypesOfBeanInjectionSpring.class, args);
}
@Bean
CommandLineRunner runIt() {
return args -> {
userService.listUsers()
.stream()
.forEach(System.out::println);
};
}
}
class User {
private String name;
public User(String name) {
this.name = name;
}
// getters and setters ...
public String getName() {
return this.name;
}
public String toString() {
return name;
}
}
interface UserService {
List<User> listUsers();
}
@Service
class UserServiceImpl implements UserService {
@Override
public List<User> listUsers() {
ArrayList<User> users = new ArrayList<>(3);
users.add(new User("Snoopy"));
users.add(new User("Woodstock"));
users.add(new User("Charlie Brown"));
return users;
}
}