/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package RestTestServiceResource;

import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.core.Application;

/**
 *
 * @author user-admin
 */
@javax.ws.rs.ApplicationPath("webresources")
public class ApplicationConfig extends Application {

    private Set<Object> singletons = new HashSet<Object>();
    private Set<Class<?>> empty = new HashSet<Class<?>>();

    public ApplicationConfig() {
        singletons.add(new CustomerClass());
    }

    @Override
    public Set<Class<?>> getClasses() {
        Set<Class<?>> resources = new java.util.HashSet<>();
        addRestResourceClasses(resources);
        return resources;
    }

    @Override
    public Set<Object> getSingletons() {
        return singletons;
    }

    /**
     * Do not modify addRestResourceClasses() method. It is automatically
     * populated with all resources defined in the project. If required, comment
     * out calling this method in getClasses().
     */
    private void addRestResourceClasses(Set<Class<?>> resources) {
        resources.add(RestTestServiceResource.CustomerClass.class);
        resources.add(RestTestServiceResource.Customers.class);
        resources.add(RestTestServiceResource.Department.class);
        resources.add(RestTestServiceResource.Products.class);
    }

//    private void addRestResourceClasses(Set<Class<?>> resources) {
//        resources.add(RestTestServiceResource.Customers.class);
//        resources.add(RestTestServiceResource.Department.class);
//        resources.add(RestTestServiceResource.Products.class);
//    }
}
