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

com.flextrade.jfixture.specifications.AnySatisfiedCompositePropertySpecification Maven / Gradle / Ivy

Go to download

JFixture is an open source library based on the popular .NET library, AutoFixture

There is a newer version: 2.7.2
Show newest version
package com.flextrade.jfixture.specifications;

import java.util.Arrays;

public class AnySatisfiedCompositePropertySpecification implements Specification {

    private final Iterable specifications;

    public AnySatisfiedCompositePropertySpecification(Specification... specifications) {
        this(Arrays.asList(specifications));
    }

    public AnySatisfiedCompositePropertySpecification(Iterable specifications) {
        if(specifications == null) throw new IllegalArgumentException("specifications");
        this.specifications = specifications;
    }

    @Override
    public boolean isSatisfiedBy(Object request) {
        for(Specification specification : this.specifications) {
            if(specification.isSatisfiedBy(request)) return true;
        }

        return false;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy