com.untzuntz.ustackserverapi.APICalls Maven / Gradle / Ivy
package com.untzuntz.ustackserverapi;
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