diff --git a/src/main/java/gov/usgs/earthquake/nshmp/calc/CalcConfig.java b/src/main/java/gov/usgs/earthquake/nshmp/calc/CalcConfig.java index 48daad717e65b25cfe428244dd220b9da169ab51..3945369d7dc145929938c43af79328ac9e97a9df 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/calc/CalcConfig.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/calc/CalcConfig.java @@ -802,9 +802,10 @@ public final class CalcConfig { private Output(Builder b) { this.directory = b.directory; - b.dataTypes.add(DataType.TOTAL); - b.dataTypes.add(DataType.MAP); - this.dataTypes = Collections.unmodifiableSet(b.dataTypes); + Set<DataType> dataTypes = EnumSet.copyOf(b.dataTypes); + dataTypes.add(DataType.TOTAL); + dataTypes.add(DataType.MAP); + this.dataTypes = Collections.unmodifiableSet(dataTypes); this.returnPeriods = List.copyOf(b.returnPeriods); } @@ -1028,6 +1029,16 @@ public final class CalcConfig { return this; } + /** + * Set the data types for which results should be calculated. + * + * @see gov.usgs.earthquake.nshmp.calc.CalcConfig.Hazard#imts + */ + public Builder dataTypes(Set<DataType> dataTypes) { + this.output.dataTypes = checkNotNull(dataTypes); + return this; + } + /** * Set the timespan for earthquake probabilities. Calling this method also * sets {@link Rate#valueFormat} to {@link ValueFormat#POISSON_PROBABILITY}