org.pitest.mutationtest.tooling.AnalysisResult Maven / Gradle / Ivy
package org.pitest.mutationtest.tooling;
import java.util.Optional;
public final class AnalysisResult {
private final Optional statistics;
private final Optional error;
private AnalysisResult(final CombinedStatistics statistics,
final Exception error) {
this.statistics = Optional.ofNullable(statistics);
this.error = Optional.ofNullable(error);
}
public static AnalysisResult success(final CombinedStatistics statistics) {
return new AnalysisResult(statistics, null);
}
public static AnalysisResult fail(final Exception error) {
return new AnalysisResult(null, error);
}
public Optional getStatistics() {
return this.statistics;
}
public Optional getError() {
return this.error;
}
}