View Javadoc
1   package de.dlr.shepard.data.timeseries.io;
2   
3   import de.dlr.shepard.data.timeseries.model.TimeseriesEntity;
4   import de.dlr.shepard.data.timeseries.model.enums.DataPointValueType;
5   import jakarta.validation.constraints.NotBlank;
6   import lombok.Data;
7   import org.eclipse.microprofile.openapi.annotations.media.Schema;
8   
9   @Schema(name = "TimeseriesEntity")
10  @Data
11  public class TimeseriesIO {
12  
13    @NotBlank
14    private final int id;
15  
16    @NotBlank
17    private final long containerId;
18  
19    @NotBlank
20    private final DataPointValueType valueType;
21  
22    @NotBlank
23    private final String measurement;
24  
25    @NotBlank
26    private final String device;
27  
28    @NotBlank
29    private final String location;
30  
31    @NotBlank
32    private final String symbolicName;
33  
34    @NotBlank
35    private final String field;
36  
37    public TimeseriesIO(TimeseriesEntity timeseriesEntity) {
38      this.id = timeseriesEntity.getId();
39      this.containerId = timeseriesEntity.getContainerId();
40      this.valueType = timeseriesEntity.getValueType();
41      this.measurement = timeseriesEntity.getMeasurement();
42      this.device = timeseriesEntity.getDevice();
43      this.location = timeseriesEntity.getLocation();
44      this.symbolicName = timeseriesEntity.getSymbolicName();
45      this.field = timeseriesEntity.getField();
46    }
47  }