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

net.thucydides.core.matchers.BeanCountMatcher Maven / Gradle / Ivy

package net.thucydides.core.matchers;

import org.hamcrest.Matcher;

import java.util.Collection;

class BeanCountMatcher implements BeanCollectionMatcher {
    
    private final Matcher countMatcher;

    public BeanCountMatcher(Matcher countMatcher) {
        this.countMatcher = countMatcher;
    }

    public  boolean matches(Collection elements) {
        return countMatcher.matches(elements.size());

    }

    @Override
    public String toString() {
        return  "number of matching entries " + countMatcher;
    }

    @Override
    public boolean matches(Object target) {
        return matches((Collection) target);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy