BookMother.java (929B)
1 package com.wimdupont.personalweb.model.dao; 2 3 import java.math.BigDecimal; 4 5 public class BookMother { 6 7 public static class Defaults { 8 public static final String ID = "id"; 9 public static final String TITLE = "title"; 10 public static final String AUTHOR = "author"; 11 public static final String ISBN = "isbn"; 12 public static final String CATEGORY = "category"; 13 public static final String SERIES = "series"; 14 public static final BigDecimal SERIES_NUMBER = BigDecimal.valueOf(2.5); 15 } 16 17 public static Book withDefaults() { 18 var book = new Book(); 19 book.setId(Defaults.ID); 20 book.setTitle(Defaults.TITLE); 21 book.setAuthor(Defaults.AUTHOR); 22 book.setIsbn(Defaults.ISBN); 23 book.setCategory(Defaults.CATEGORY); 24 book.setSeries(Defaults.SERIES); 25 book.setSeriesNumber(Defaults.SERIES_NUMBER); 26 return book; 27 } 28 }