com.fireflysource.net.http.server.Matcher Maven / Gradle / Ivy
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();
}