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

net.thucydides.core.requirements.PathStartsWith Maven / Gradle / Ivy

There is a newer version: 4.2.1
Show newest version
package net.thucydides.core.requirements;

import java.util.List;

class PathStartsWith {
    private List storyPathElements;

    public PathStartsWith(List storyPathElements) {
        this.storyPathElements = storyPathElements;
    }

    public boolean startsWith(List rootElements) {
        if (storyPathElements.size() >= rootElements.size()) {
            int elementIndex = 0;
            for(String pathElement : rootElements) {
                if (!pathElement.equals(storyPathElements.get(elementIndex++))) {
                    return false;
                }
            }
            return true;
        } else {
            return false;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy