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

com.cybermkd.route.handler.HandlerFactory Maven / Gradle / Ivy

package com.cybermkd.route.handler;

import java.util.List;

/**
 * HandlerFactory.
 */
public class HandlerFactory {

    private HandlerFactory() {

    }

    /**
     * Build handler chain
     */
    public static Handler getHandler(List handlerList, Handler actionHandler) {
        Handler result = actionHandler;

        for (int i = handlerList.size() - 1; i >= 0; i--) {
            Handler temp = handlerList.get(i);
            temp.nextHandler = result;
            result = temp;
        }

        return result;
    }
}








© 2015 - 2024 Weber Informatics LLC | Privacy Policy