com.flextrade.jfixture.specifications.AnySatisfiedCompositePropertySpecification Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jfixture Show documentation
Show all versions of jfixture Show documentation
JFixture is an open source library based on the popular .NET library, AutoFixture
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;
}
}