@@ -32,9 +32,6 @@ public class InfluxDbWeatherSource implements WeatherSource {
32
32
private static final String COORDINATE_ID_COLUMN_NAME = "coordinate_id" ;
33
33
private static final int MILLI_TO_NANO_FACTOR = 1000000 ;
34
34
35
- /* Final name of the coordinate id field for use in factories */
36
- private final String coordinateIdFieldName ;
37
- /* Final name of the column within the database */
38
35
private final InfluxDbConnector connector ;
39
36
private final IdCoordinateSource coordinateSource ;
40
37
private final TimeBasedWeatherValueFactory weatherValueFactory ;
@@ -54,7 +51,6 @@ public InfluxDbWeatherSource(
54
51
this .connector = connector ;
55
52
this .coordinateSource = coordinateSource ;
56
53
this .weatherValueFactory = weatherValueFactory ;
57
- this .coordinateIdFieldName = weatherValueFactory .getCoordinateIdFieldString ();
58
54
}
59
55
60
56
@ Override
@@ -145,14 +141,15 @@ public Optional<TimeBasedValue<WeatherValue>> getWeather(ZonedDateTime date, Poi
145
141
}
146
142
147
143
/**
148
- * Parses an influxQL QueryResult and then transforms them into a Stream of optional
149
- * TimeBasedValue<WeatherValue>, with a present Optional value, if the transformation was
150
- * successful and an empty optional otherwise.
144
+ * Parses an influxQL QueryResult and then transforms it into a Stream of optional
145
+ * TimeBasedValue<WeatherValue>, with a present Optional value if the transformation was
146
+ * successful and an empty Optional otherwise.
151
147
*/
152
148
private Stream <Optional <TimeBasedValue <WeatherValue >>> optTimeBasedValueStream (
153
149
QueryResult queryResult ) {
154
150
Map <String , Set <Map <String , String >>> measurementsMap =
155
151
InfluxDbConnector .parseQueryResult (queryResult , MEASUREMENT_NAME_WEATHER );
152
+ final String coordinateIdFieldName = weatherValueFactory .getCoordinateIdFieldString ();
156
153
return measurementsMap .get (MEASUREMENT_NAME_WEATHER ).stream ()
157
154
.map (
158
155
fieldToValue -> {
0 commit comments