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

com.thoughtworks.gauge.tag.TagMatcher Maven / Gradle / Ivy

/*----------------------------------------------------------------
 *  Copyright (c) ThoughtWorks, Inc.
 *  Licensed under the Apache License, Version 2.0
 *  See LICENSE.txt in the project root for license information.
 *----------------------------------------------------------------*/
package com.thoughtworks.gauge.tag;

import com.thoughtworks.gauge.Operator;

import java.util.List;

public class TagMatcher {
    public boolean isMatch(List tags, Operator operator, List allTags) {
        return new TagMatcherFactory().matcherFor(operator).isMatch(tags, allTags);
    }

    private class TagMatcherFactory {
        public SimpleTagMatcher matcherFor(Operator operator) {
            switch (operator) {
                case OR:
                    return new OrMatcher();
                case AND:
                    return new AndMatcher();
                default:
                    return new AndMatcher();
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy