Mercurial > dive4elements > river
view artifacts/src/main/java/org/dive4elements/river/artifacts/model/CrossSectionFacetUtils.java @ 9638:6c1ebf2220f5
# 19b (check for usages of WaterlevelExporter.getWforGaugeAndQ) -> cleanup: removing calc.extreme.curve
author | dnt_bjoernsen <d.tironi@bjoernsen.de> |
---|---|
date | Thu, 31 Oct 2019 17:37:53 +0100 |
parents | 853f2dafc16e |
children |
line wrap: on
line source
/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde * Software engineering by * Björnsen Beratende Ingenieure GmbH * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt * * This file is Free Software under the GNU AGPL (>=v3) * and comes with ABSOLUTELY NO WARRANTY! Check out the * documentation coming with Dive4Elements River for details. */ package org.dive4elements.river.artifacts.model; import java.util.List; import org.apache.log4j.Logger; import org.dive4elements.artifacts.CallContext; import org.dive4elements.artifacts.DataProvider; import org.dive4elements.river.model.FastCrossSectionLine; /** * @author Domenico Nardi Tironi */ public final class CrossSectionFacetUtils { private static Logger log = Logger.getLogger(CrossSectionFacetUtils.class); private CrossSectionFacetUtils() { throw new UnsupportedOperationException(); } public static DataProvider getDataProvider(final CallContext context) { final List<DataProvider> providers = context.getDataProvider(CrossSectionFacet.BLACKBOARD_CS_MASTER_DATA); if (providers.size() < 1) { log.warn("Could not find Cross-Section data provider."); return null; } return providers.get(0); } public static FastCrossSectionLine getCrossSection(final DataProvider provider, final CallContext context) { if (provider == null) return null; return (FastCrossSectionLine) provider.provideData(CrossSectionFacet.BLACKBOARD_CS_MASTER_DATA, null, context); } }