diff src/goodjava/webserver/handlers/ListHandler.java @ 1402:27efb1fcbcb5

move luan.lib to goodjava
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 17 Sep 2019 01:35:01 -0400
parents src/luan/lib/webserver/handlers/ListHandler.java@643cf1c37723
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/goodjava/webserver/handlers/ListHandler.java	Tue Sep 17 01:35:01 2019 -0400
@@ -0,0 +1,23 @@
+package goodjava.webserver.handlers;
+
+import goodjava.webserver.Handler;
+import goodjava.webserver.Request;
+import goodjava.webserver.Response;
+
+
+public final class ListHandler implements Handler {
+	private final Handler[] handlers;
+
+	public ListHandler(Handler... handlers) {
+		this.handlers = handlers;
+	}
+
+	public Response handle(Request request) {
+		for( Handler handler : handlers ) {
+			Response response = handler.handle(request);
+			if( response != null )
+				return response;
+		}
+		return null;
+	}
+}