All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.textrecruit.ustackserverapi.APICalls Maven / Gradle / Ivy

There is a newer version: 1.0.31
Show newest version
package com.textrecruit.ustackserverapi;

import com.textrecruit.ustackserverapi.APIException;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class APICalls {

	static final List errors = new ArrayList();
	
	public static List getErrors() {
		return errors;
	}
	
	public static void addException(APIException e) {
		errors.add(e);
	}
	
    static final Map routing = new HashMap();

    public static List getMethods() {
    	List list = new ArrayList();
    	Iterator it = routing.keySet().iterator();
    	while (it.hasNext()) {
    		String route = it.next();
    		list.add(routing.get(route));
    	}
    	return list;
    }
    
    public static void clearRoutes() {
    	routing.clear();
    }
    
    public static void addRoute(MethodDefinition def) {
    	routing.put(def.getPath(), def);
    }
    
    public static MethodDefinition getCallByURI(String path) {
    	return routing.get(path);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy