annotate artifacts/src/main/java/org/dive4elements/river/artifacts/access/RiverAccess.java @ 9801:1d7a72a50183 3.2.x tip

Assume Compose V2, consistently
author Tom Gottfried <tom@intevation.de>
date Thu, 23 Nov 2023 10:14:13 +0100
parents 0a5239a1e46e
children
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4118
diff changeset
9 package org.dive4elements.river.artifacts.access;
3777
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
11 import org.dive4elements.river.artifacts.D4EArtifact;
3777
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
12
7261
a56fe3bc6700 Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
13 import org.dive4elements.river.artifacts.model.RiverFactory;
a56fe3bc6700 Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
14
a56fe3bc6700 Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
15 import org.dive4elements.river.model.River;
a56fe3bc6700 Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
16
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
17 import org.apache.logging.log4j.Logger;
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
18 import org.apache.logging.log4j.LogManager;
3777
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
19
4118
116464587b51 Documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3777
diff changeset
20 /** Access to river data of an artifact. */
3777
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
21 public class RiverAccess
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
22 extends Access
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23 {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7261
diff changeset
24 /** Private log. */
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
25 private static Logger log = LogManager.getLogger(RiverAccess.class);
3777
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26
4118
116464587b51 Documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3777
diff changeset
27 /** River name. */
3777
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28 protected String river;
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29
4118
116464587b51 Documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3777
diff changeset
30
3777
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31 public RiverAccess() {
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
32 }
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
34 public RiverAccess(D4EArtifact artifact) {
3777
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
35 super(artifact);
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
36 }
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
37
4118
116464587b51 Documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3777
diff changeset
38
116464587b51 Documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3777
diff changeset
39 /** Get River name. */
7261
a56fe3bc6700 Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
40 public String getRiverName() {
3777
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
41 if (river == null) {
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
42 river = getString("river");
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
43 }
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
44 if (log.isDebugEnabled()) {
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
45 log.debug("river: '" + river + "'");
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
46 }
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
47 return river;
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
48 }
7261
a56fe3bc6700 Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
49
a56fe3bc6700 Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
50 public River getRiver() {
a56fe3bc6700 Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
51 getRiverName();
a56fe3bc6700 Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
52
a56fe3bc6700 Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
53 return (river != null)
a56fe3bc6700 Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
54 ? RiverFactory.getRiver(river)
a56fe3bc6700 Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
55 : null;
a56fe3bc6700 Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
56 }
3777
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
57 }
048a02e29808 Added base class RiverAccess to dense code to access the river name.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
58 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org