From c75da10974788fa2c489b6ee4f1c420677eb4230 Mon Sep 17 00:00:00 2001 From: Brandon Clayton <bclayton@usgs.gov> Date: Thu, 21 Jul 2022 09:40:31 -0600 Subject: [PATCH] add hazard metadata class --- .../nshmp/netcdf/www/HazardMetadata.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/hazard/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/HazardMetadata.java diff --git a/src/hazard/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/HazardMetadata.java b/src/hazard/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/HazardMetadata.java new file mode 100644 index 0000000..2e83787 --- /dev/null +++ b/src/hazard/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/HazardMetadata.java @@ -0,0 +1,37 @@ +package gov.usgs.earthquake.nshmp.netcdf.www; + +import gov.usgs.earthquake.nshmp.gmm.Imt; +import gov.usgs.earthquake.nshmp.gmm.NehrpSiteClass; +import gov.usgs.earthquake.nshmp.netcdf.Nshm; +import gov.usgs.earthquake.nshmp.netcdf.www.Metadata.ServiceResponseMetadata; +import gov.usgs.earthquake.nshmp.netcdf.www.Request.RequestData; +import gov.usgs.earthquake.nshmp.netcdf.www.RequestHazardCurves.HazardRequestDataImt; + +/** + * Hazard metadata. + * + * @author U.S. Geological Survey + */ +public class HazardMetadata { + + static class HazardResponseMetadata extends ServiceResponseMetadata { + public final Nshm nshm; + public final Imt imt; + + HazardResponseMetadata( + Nshm nshm, + NehrpSiteClass siteClass, + Imt imt, + String xLabel, + String yLabel) { + super(siteClass, xLabel, yLabel); + this.nshm = nshm; + this.imt = imt; + } + + @Override + public HazardRequestDataImt toRequestMetadata(RequestData requestData) { + return new HazardRequestDataImt(nshm, requestData.site, siteClass, imt, requestData.format); + } + } +} -- GitLab