// Path: src/main/java/thymeleafexamples/gtvg/business/entities/Customer.java
// public class Customer {
// 
//     private Integer id = null;
//     private String name = null;
//     private Calendar customerSince = null;
// 
//     
//     public Customer() {
//         super();
//     }
// 
// 
//     public Integer getId() {
//         return this.id;
//     }
//     public void setId(final Integer id) {
//         this.id = id;
//     }
//     
// 
//     public String getName() {
//         return this.name;
//     }
//     public void setName(final String name) {
//         this.name = name;
//     }
//     
// 
//     public Calendar getCustomerSince() {
//         return this.customerSince;
//     }
//     public void setCustomerSince(final Calendar customerSince) {
//         this.customerSince = customerSince;
//     }
//     
// }
// 
// Path: src/main/java/thymeleafexamples/gtvg/business/util/CalendarUtil.java
// public class CalendarUtil {
//     
//     
//     public static Calendar calendarFor(
//             final int year,  final int month, final int day, final int hour, final int minute) {
//         
//         final Calendar cal = Calendar.getInstance();
//         cal.set(Calendar.YEAR, year);
//         cal.set(Calendar.MONTH, month - 1);
//         cal.set(Calendar.DAY_OF_MONTH, day);
//         cal.set(Calendar.HOUR_OF_DAY, hour);
//         cal.set(Calendar.MINUTE, minute);
//         cal.set(Calendar.SECOND, 0);
//         cal.set(Calendar.MILLISECOND, 0);
//         return cal;
//         
//     }
// 
//     
//     
//     private CalendarUtil() {
//         super();
//     }
//     
//     
// }


import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import thymeleafexamples.gtvg.business.entities.Customer;
import thymeleafexamples.gtvg.business.util.CalendarUtil;
/*
 * =============================================================================
 * 
 *   Copyright (c) 2011-2016, The THYMELEAF team (http://www.thymeleaf.org)
 * 
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 * 
 * =============================================================================
 */
package thymeleafexamples.gtvg.business.entities.repositories;




public class CustomerRepository {

    private static final CustomerRepository INSTANCE = new CustomerRepository();
    private final Map<Integer,Customer> customersById;

    
    
    public static CustomerRepository getInstance() {
        return INSTANCE;
    }
   
    
    
    private CustomerRepository() {
        
        super();
        
        this.customersById = new LinkedHashMap<Integer, Customer>();
        
        final Customer cust1 = new Customer();
        cust1.setId(Integer.valueOf(1));
        cust1.setName("James Cucumber");
        cust1.setCustomerSince(CalendarUtil.calendarFor(2006, 4, 2, 13, 20));
        this.customersById.put(cust1.getId(), cust1);
        
        final Customer cust2 = new Customer();
        cust2.setId(Integer.valueOf(2));
        cust2.setName("Anna Lettuce");
        cust2.setCustomerSince(CalendarUtil.calendarFor(2005, 1, 30, 17, 14));
        this.customersById.put(cust2.getId(), cust2);
        
        final Customer cust3 = new Customer();
        cust3.setId(Integer.valueOf(3));
        cust3.setName("Boris Tomato");
        cust3.setCustomerSince(CalendarUtil.calendarFor(2008, 12, 2, 9, 53));
        this.customersById.put(cust3.getId(), cust3);
        
        final Customer cust4 = new Customer();
        cust4.setId(Integer.valueOf(4));
        cust4.setName("Shannon Parsley");
// Path: src/main/java/thymeleafexamples/gtvg/business/entities/Customer.java
// public class Customer {
// 
//     private Integer id = null;
//     private String name = null;
//     private Calendar customerSince = null;
// 
//     
//     public Customer() {
//         super();
//     }
// 
// 
//     public Integer getId() {
//         return this.id;
//     }
//     public void setId(final Integer id) {
//         this.id = id;
//     }
//     
// 
//     public String getName() {
//         return this.name;
//     }
//     public void setName(final String name) {
//         this.name = name;
//     }
//     
// 
//     public Calendar getCustomerSince() {
//         return this.customerSince;
//     }
//     public void setCustomerSince(final Calendar customerSince) {
//         this.customerSince = customerSince;
//     }
//     
// }
// 
// Path: src/main/java/thymeleafexamples/gtvg/business/util/CalendarUtil.java
// public class CalendarUtil {
//     
//     
//     public static Calendar calendarFor(
//             final int year,  final int month, final int day, final int hour, final int minute) {
//         
//         final Calendar cal = Calendar.getInstance();
//         cal.set(Calendar.YEAR, year);
//         cal.set(Calendar.MONTH, month - 1);
//         cal.set(Calendar.DAY_OF_MONTH, day);
//         cal.set(Calendar.HOUR_OF_DAY, hour);
//         cal.set(Calendar.MINUTE, minute);
//         cal.set(Calendar.SECOND, 0);
//         cal.set(Calendar.MILLISECOND, 0);
//         return cal;
//         
//     }
// 
//     
//     
//     private CalendarUtil() {
//         super();
//     }
//     
//     
// }


// Path: src/main/java/thymeleafexamples/gtvg/business/entities/repositories/CustomerRepository.java
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import thymeleafexamples.gtvg.business.entities.Customer;
import thymeleafexamples.gtvg.business.util.CalendarUtil;

/*
 * =============================================================================
 * 
 *   Copyright (c) 2011-2016, The THYMELEAF team (http://www.thymeleaf.org)
 * 
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 * 
 * =============================================================================
 */
package thymeleafexamples.gtvg.business.entities.repositories;




public class CustomerRepository {

    private static final CustomerRepository INSTANCE = new CustomerRepository();
    private final Map<Integer,Customer> customersById;

    
    
    public static CustomerRepository getInstance() {
        return INSTANCE;
    }
   
    
    
    private CustomerRepository() {
        
        super();
        
        this.customersById = new LinkedHashMap<Integer, Customer>();
        
        final Customer cust1 = new Customer();
        cust1.setId(Integer.valueOf(1));
        cust1.setName("James Cucumber");
        cust1.setCustomerSince(CalendarUtil.calendarFor(2006, 4, 2, 13, 20));
        this.customersById.put(cust1.getId(), cust1);
        
        final Customer cust2 = new Customer();
        cust2.setId(Integer.valueOf(2));
        cust2.setName("Anna Lettuce");
        cust2.setCustomerSince(CalendarUtil.calendarFor(2005, 1, 30, 17, 14));
        this.customersById.put(cust2.getId(), cust2);
        
        final Customer cust3 = new Customer();
        cust3.setId(Integer.valueOf(3));
        cust3.setName("Boris Tomato");
        cust3.setCustomerSince(CalendarUtil.calendarFor(2008, 12, 2, 9, 53));
        this.customersById.put(cust3.getId(), cust3);
        
        final Customer cust4 = new Customer();
        cust4.setId(Integer.valueOf(4));
        cust4.setName("Shannon Parsley");
        cust4.setCustomerSince(CalendarUtil.calendarFor(2009, 3, 24, 10, 45));