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

com.nike.riposte.server.error.exception.MultipleMatchingEndpointsException Maven / Gradle / Ivy

There is a newer version: 0.20.0
Show newest version
package com.nike.riposte.server.error.exception;

import com.nike.riposte.server.http.Endpoint;

import java.util.List;
import java.util.stream.Collectors;

/**
 * Thrown when multiple endpoints want to match a request (with both path and HTTP method matching).
 *
 * @author Nic Munroe
 */
public class MultipleMatchingEndpointsException extends RuntimeException {

    public final List matchingEndpointsDetails;
    public final String requestPath;
    public final String requestMethod;

    public MultipleMatchingEndpointsException(String message, List> fullyMatchingEndpoints,
                                              String requestPath, String requestMethod) {
        super(message);
        this.matchingEndpointsDetails = fullyMatchingEndpoints.stream()
                                                              .map(e -> e.getClass().getName())
                                                              .collect(Collectors.toList());
        this.requestPath = requestPath;
        this.requestMethod = requestMethod;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy