com.insightfullogic.lambdabehave.impl.reports.SuiteReport Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lambda-behave Show documentation
Show all versions of lambda-behave Show documentation
A modern testing and behavioural specification framework for Java 8
package com.insightfullogic.lambdabehave.impl.reports;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Stream;
public final class SuiteReport {
private final String name;
private final List specifications;
public SuiteReport(final String name) {
Objects.requireNonNull(name);
this.name = name;
specifications = new ArrayList<>();
}
public SuiteReport with(final SpecificationReport specification) {
specifications.add(specification);
return this;
}
public Stream specifications() {
return specifications.stream();
}
public List getSpecifications() {
return specifications;
}
public String getName() {
return name;
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SuiteReport that = (SuiteReport) o;
if (!name.equals(that.name)) return false;
if (!specifications.equals(that.specifications)) return false;
return true;
}
@Override
public int hashCode() {
int result = name.hashCode();
result = 31 * result + specifications.hashCode();
return result;
}
@Override
public String toString() {
return "SuiteReport{" +
"name='" + name + '\'' +
", specifications=" + specifications +
'}';
}
}