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

com.fireflysource.net.http.server.Matcher Maven / Gradle / Ivy

There is a newer version: 5.0.2
Show newest version
package com.fireflysource.net.http.server;

import java.util.Collections;
import java.util.Map;
import java.util.SortedSet;

public interface Matcher {

    enum MatchType {
        PATH, METHOD, ACCEPT, CONTENT_TYPE
    }

    class MatchResult {
        private final SortedSet routers;
        private final Map> parameters;
        private final MatchType matchType;

        public MatchResult(SortedSet routers, Map> parameters, MatchType matchType) {
            this.routers = routers;
            this.parameters = Collections.unmodifiableMap(parameters);
            this.matchType = matchType;
        }

        public SortedSet getRouters() {
            return routers;
        }

        public Map> getParameters() {
            return parameters;
        }

        public MatchType getMatchType() {
            return matchType;
        }
    }

    void add(String rule, Router router);

    MatchResult match(String value);

    MatchType getMatchType();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy