[PATCH 1 of 2] Extracting some winfo logic without breaking old code

Wald Commits scm-commit at wald.intevation.org
Tue Mar 6 17:05:20 CET 2018


# HG changeset patch
# User gernotbelger
# Date 1520352299 -3600
# Node ID 8731c3dabb563a7d3818c28990f554fc2d122c9d
# Parent  b10f8415798c9fdecbab1c53389e0c11a805a91a
Extracting some winfo logic without breaking old code

diff -r b10f8415798c -r 8731c3dabb56 artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java	Tue Mar 06 17:04:17 2018 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java	Tue Mar 06 17:04:59 2018 +0100
@@ -85,9 +85,17 @@
     public static final String CSV_Q_HEADER =
         "export.waterlevel.csv.header.q";
 
+    /**
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
+     */
+    @Deprecated
     public static final String CSV_Q_DESC_HEADER =
         "export.waterlevel.csv.header.q.desc";
 
+    /**
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
+     */
+    @Deprecated
     public static final String CSV_W_DESC_HEADER =
         "export.waterlevel.csv.header.w.desc";
 
@@ -130,7 +138,15 @@
     public static final String DEFAULT_CSV_KM_HEADER       = "Fluss-Km";
     public static final String DEFAULT_CSV_W_HEADER        = "W [NN + m]";
     public static final String DEFAULT_CSV_Q_HEADER        = "Q [m\u00b3/s]";
+    /**
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
+     */
+    @Deprecated
     public static final String DEFAULT_CSV_Q_DESC_HEADER   = "Bezeichnung";
+    /**
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
+     */
+    @Deprecated
     public static final String DEFAULT_CSV_W_DESC_HEADER   = "W/Pegel [cm]";
     public static final String DEFAULT_CSV_LOCATION_HEADER = "Lage";
     public static final String DEFAULT_CSV_GAUGE_HEADER    = "Bezugspegel";
@@ -268,6 +284,10 @@
     }
 
 
+    /**
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
+     */
+    @Deprecated
     protected String getCSVRowTitle(WINFOArtifact winfo, WQKms wqkms) {
         log.debug("WaterlevelExporter.prepareNamedValue");
 
@@ -299,7 +319,10 @@
     /**
      * Get a string like 'W=' or 'Q=' with a number following in localized
      * format.
+     * 
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
      */
+    @Deprecated
     protected String localizeWQKms(WINFOArtifact winfo, WQKms wqkms) {
         WQ_MODE wqmode   = RiverUtils.getWQMode(winfo);
         Double  rawValue = wqkms.getRawValue();
@@ -548,6 +571,8 @@
                 msg(CSV_KM_HEADER, DEFAULT_CSV_KM_HEADER),
                 msg(CSV_W_HEADER, DEFAULT_CSV_W_HEADER, new Object[] { unit }),
                 msg(CSV_Q_HEADER, DEFAULT_CSV_Q_HEADER),
+                
+                // FIXME: use WaterlevelDescriptionBuilder instead and also remove all this duplicate code.
                 (isQ
                     ? msg(CSV_Q_DESC_HEADER, DEFAULT_CSV_Q_DESC_HEADER)
                     : msg(CSV_W_DESC_HEADER, DEFAULT_CSV_W_DESC_HEADER)),
@@ -616,6 +641,10 @@
         });
     }
 
+    /**
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
+     */
+    @Deprecated
     private String getDesc(WQKms wqkms, boolean isQ)
     {
         D4EArtifact flys = (D4EArtifact) master;


More information about the Dive4Elements-commits mailing list