-
Notifications
You must be signed in to change notification settings - Fork 5
/
TimeBasedWeatherValueFactory.java
53 lines (44 loc) · 1.53 KB
/
TimeBasedWeatherValueFactory.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* © 2021. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/
package edu.ie3.datamodel.io.factory.timeseries;
import edu.ie3.datamodel.models.value.WeatherValue;
import edu.ie3.util.TimeUtil;
import java.time.format.DateTimeFormatter;
/**
* Abstract factory to handle the conversion from "flat" field to value mapping onto actual {@link
* TimeBasedValueFactory} with {@link WeatherValue}
*/
public abstract class TimeBasedWeatherValueFactory
extends TimeBasedValueFactory<TimeBasedWeatherValueData, WeatherValue> {
protected static final String UUID = "uuid";
protected static final String TIME = "time";
protected static final String COORDINATE_ID = "coordinateId";
protected final TimeUtil timeUtil;
protected TimeBasedWeatherValueFactory() {
this.timeUtil = new TimeUtil(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
}
protected TimeBasedWeatherValueFactory(DateTimeFormatter dateTimeFormatter) {
this(new TimeUtil(dateTimeFormatter));
}
protected TimeBasedWeatherValueFactory(TimeUtil timeUtil) {
super(WeatherValue.class);
this.timeUtil = timeUtil;
}
/**
* Return the field name for the coordinate id
*
* @return the field name for the coordinate id
*/
public String getCoordinateIdFieldString() {
return COORDINATE_ID;
}
/**
* Return the field name for the date time
*
* @return the field name for the date time
*/
public abstract String getTimeFieldString();
}