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

org.jboss.resteasy.reactive.server.model.FixedHandlerChainCustomizer Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package org.jboss.resteasy.reactive.server.model;

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

import org.jboss.resteasy.reactive.common.model.ResourceClass;
import org.jboss.resteasy.reactive.server.spi.ServerRestHandler;

public class FixedHandlerChainCustomizer implements HandlerChainCustomizer {

    private ServerRestHandler handler;
    private Phase phase;

    public FixedHandlerChainCustomizer(ServerRestHandler handler, Phase phase) {
        this.handler = handler;
        this.phase = phase;
    }

    public FixedHandlerChainCustomizer() {
    }

    @Override
    public List handlers(Phase phase, ResourceClass resourceClass,
            ServerResourceMethod serverResourceMethod) {
        if (this.phase == phase) {
            return Collections.singletonList(handler);
        }
        return Collections.emptyList();
    }

    public ServerRestHandler getHandler() {
        return handler;
    }

    public FixedHandlerChainCustomizer setHandler(ServerRestHandler handler) {
        this.handler = handler;
        return this;
    }

    public Phase getPhase() {
        return phase;
    }

    public FixedHandlerChainCustomizer setPhase(Phase phase) {
        this.phase = phase;
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy