Merge pull request #8125 from eugenp/revert-8119-BAEL-3275-2

Revert "BAEL-3275: Using blocking queue for pub-sub"
This commit is contained in:
Eric Martin
2019-10-31 20:43:47 -05:00
committed by GitHub
parent db85c8f275
commit 3225470df5
20543 changed files with 1642750 additions and 0 deletions
@@ -0,0 +1,8 @@
package com.baeldung.thymeleaf.utils;
public class ArrayUtil {
public static String[] array(String... args) {
return args;
}
}
@@ -0,0 +1,28 @@
package com.baeldung.thymeleaf.utils;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.IntStream;
import com.baeldung.thymeleaf.model.Book;
public class BookUtils {
private static List<Book> books = new ArrayList<Book>();
private static final int NUM_BOOKS = 30;
private static final int MIN_BOOK_NUM = 1000;
public static List<Book> buildBooks() {
if (books.isEmpty()) {
IntStream.range(0, NUM_BOOKS).forEach(n -> {
books.add(new Book(MIN_BOOK_NUM + n + 1, "Spring in Action"));
});
}
return books;
}
}
@@ -0,0 +1,34 @@
package com.baeldung.thymeleaf.utils;
import java.util.ArrayList;
import java.util.List;
import com.baeldung.thymeleaf.model.Student;
public class StudentUtils {
private static List<Student> students = new ArrayList<Student>();
public static List<Student> buildStudents() {
if (students.isEmpty()) {
Student student1 = new Student();
student1.setId(1001);
student1.setName("John Smith");
student1.setGender('M');
student1.setPercentage(Float.valueOf("80.45"));
students.add(student1);
Student student2 = new Student();
student2.setId(1002);
student2.setName("Jane Williams");
student2.setGender('F');
student2.setPercentage(Float.valueOf("60.25"));
students.add(student2);
}
return students;
}
}
@@ -0,0 +1,47 @@
package com.baeldung.thymeleaf.utils;
import java.util.ArrayList;
import java.util.List;
import com.baeldung.thymeleaf.model.Teacher;
public class TeacherUtils {
private static List<Teacher> teachers = new ArrayList<Teacher>();
public static List<Teacher> buildTeachers() {
if (teachers.isEmpty()) {
Teacher teacher1 = new Teacher();
teacher1.setId(2001);
teacher1.setName("Jane Doe");
teacher1.setGender("F");
teacher1.setActive(true);
teacher1.getCourses().add("Mathematics");
teacher1.getCourses().add("Physics");
teachers.add(teacher1);
Teacher teacher2 = new Teacher();
teacher2.setId(2002);
teacher2.setName("Lazy Dude");
teacher2.setGender("M");
teacher2.setActive(false);
teacher2.setAdditionalSkills("emergency responder");
teachers.add(teacher2);
Teacher teacher3 = new Teacher();
teacher3.setId(2002);
teacher3.setName("Micheal Jordan");
teacher3.setGender("M");
teacher3.setActive(true);
teacher3.getCourses().add("Sports");
teachers.add(teacher3);
}
return teachers;
}
}