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

com.github.aidensuen.mongo.plugin.InterceptorChain Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
package com.github.aidensuen.mongo.plugin;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class InterceptorChain {

    private final List interceptors = new ArrayList<>();

    public Object pluginAll(Object target) {
        for (Interceptor interceptor : interceptors) {
            target = interceptor.plugin(target);
        }
        return target;
    }

    public void addInterceptor(Interceptor interceptor) {
        interceptors.add(interceptor);
    }

    public List getInterceptors() {
        return Collections.unmodifiableList(interceptors);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy