class Matcher {

    public boolean matches(String s) {
        switch (type) {
            case MatchEqual:
                return s == value;
            case MatchNotEqual:
                return s != value;
            case MatchRegexp:
                return matchString(s);
            case MatchNotRegexp:
                return !matchString(s);
            case MatchLiteralOr:
                return value.indexOf(s) > -1;
            case MatchNotLiteralOr:
                return !(value.indexOf(s) > -1);
        }
        throw new IllegalStateException("labels.Matcher.Matches: invalid match type");
    }

    public  Matcher(MatchType type, String name, String value);

}