Skip to content

Commit ab7fb28

Browse files
committed
fmt
1 parent fda8e99 commit ab7fb28

File tree

10 files changed

+54
-31
lines changed

10 files changed

+54
-31
lines changed

src/main/java/edu/ie3/datamodel/io/connectors/CsvFileConnector.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ public Optional<IndividualTimeSeriesMetaInformation> getIndividualTimeSeriesMeta
204204
*/
205205
private Map<UUID, CsvIndividualTimeSeriesMetaInformation>
206206
buildIndividualTimeSeriesMetaInformation() {
207-
return getIndividualTimeSeriesFilePaths().parallelStream()
207+
return getIndividualTimeSeriesFilePaths()
208+
.parallelStream()
208209
.map(
209210
filePath -> {
210211
/* Extract meta information from file path and enhance it with the file path itself */
@@ -232,7 +233,8 @@ public Optional<IndividualTimeSeriesMetaInformation> getIndividualTimeSeriesMeta
232233
@Deprecated
233234
public Map<ColumnScheme, Set<TimeSeriesReadingData>> initTimeSeriesReader(
234235
ColumnScheme... columnSchemes) {
235-
return getIndividualTimeSeriesFilePaths().parallelStream()
236+
return getIndividualTimeSeriesFilePaths()
237+
.parallelStream()
236238
.map(
237239
pathString -> {
238240
String filePathWithoutEnding = removeFileEnding(pathString);

src/main/java/edu/ie3/datamodel/io/processor/timeseries/TimeSeriesProcessor.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ private SortedMap<String, FieldSourceToMethod> buildFieldToSource(
106106
Class<T> timeSeriesClass, Class<E> entryClass, Class<V> valueClass) {
107107
/* Get the mapping from field name to getter method ignoring the getter for returning all entries */
108108
Map<String, FieldSourceToMethod> timeSeriesMapping =
109-
mapFieldNameToGetter(timeSeriesClass, Arrays.asList("entries", "uuid", "type"))
110-
.entrySet()
109+
mapFieldNameToGetter(timeSeriesClass, Arrays.asList("entries", "uuid", "type")).entrySet()
111110
.stream()
112111
.collect(
113112
Collectors.toMap(
@@ -137,8 +136,7 @@ private SortedMap<String, FieldSourceToMethod> buildFieldToSource(
137136
mapFieldNameToGetter(
138137
valueClass,
139138
Arrays.asList("solarIrradiance", "temperature", "wind"))
140-
.entrySet()
141-
.stream()
139+
.entrySet().stream()
142140
.map(
143141
entry ->
144142
new AbstractMap.SimpleEntry<>(

src/main/java/edu/ie3/datamodel/io/source/csv/CsvDataSource.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,10 @@ protected Stream<Map<String, String>> buildStreamWithFieldsToAttributesMap(
394394
Collection<Map<String, String>> allRows = csvRowFieldValueMapping(reader, headline);
395395

396396
return distinctRowsWithLog(
397-
allRows, fieldToValues -> fieldToValues.get("uuid"), entityClass.getSimpleName(), "UUID")
397+
allRows,
398+
fieldToValues -> fieldToValues.get("uuid"),
399+
entityClass.getSimpleName(),
400+
"UUID")
398401
.parallelStream();
399402
} catch (IOException e) {
400403
log.warn(
@@ -453,7 +456,8 @@ protected Set<Map<String, String>> distinctRowsWithLog(
453456

454457
/* Check for rows with the same key based on the provided key extractor function */
455458
Set<Map<String, String>> distinctIdSet =
456-
allRowsSet.parallelStream()
459+
allRowsSet
460+
.parallelStream()
457461
.filter(ValidationUtils.distinctByKey(keyExtractor))
458462
.collect(Collectors.toSet());
459463
if (distinctIdSet.size() != allRowsSet.size()) {

src/main/java/edu/ie3/datamodel/io/source/csv/CsvIdCoordinateSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ protected Stream<Map<String, String>> buildStreamWithFieldsToAttributesMap() {
123123
.get(factory.getLatField())
124124
.concat(fieldToValues.get(factory.getLonField()));
125125
return distinctRowsWithLog(
126-
withDistinctCoordinateId, coordinateExtractor, "coordinate id mapping", "coordinate")
126+
withDistinctCoordinateId, coordinateExtractor, "coordinate id mapping", "coordinate")
127127
.parallelStream();
128128
} catch (IOException e) {
129129
log.error("Cannot read the file for coordinate id to coordinate mapping.", e);

src/main/java/edu/ie3/datamodel/io/source/csv/CsvWeatherSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ protected Stream<Map<String, String>> buildStreamWithFieldsToAttributesMap(
246246
.get(weatherFactory.getTimeFieldString())
247247
.concat(fieldToValues.get(weatherFactory.getCoordinateIdFieldString()));
248248
return distinctRowsWithLog(
249-
allRows, timeCoordinateIdExtractor, entityClass.getSimpleName(), "UUID")
249+
allRows, timeCoordinateIdExtractor, entityClass.getSimpleName(), "UUID")
250250
.parallelStream();
251251

252252
} catch (IOException e) {

src/main/java/edu/ie3/datamodel/models/input/container/GraphicElements.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ public GraphicElements(List<GraphicInput> graphics) {
4848

4949
/* init sets */
5050
this.nodeGraphics =
51-
graphics.parallelStream()
51+
graphics
52+
.parallelStream()
5253
.filter(graphic -> graphic instanceof NodeGraphicInput)
5354
.map(graphic -> (NodeGraphicInput) graphic)
5455
.collect(Collectors.toSet());
5556
this.lineGraphics =
56-
graphics.parallelStream()
57+
graphics
58+
.parallelStream()
5759
.filter(graphic -> graphic instanceof LineGraphicInput)
5860
.map(graphic -> (LineGraphicInput) graphic)
5961
.collect(Collectors.toSet());

src/main/java/edu/ie3/datamodel/models/input/container/RawGridElements.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,32 +84,38 @@ public RawGridElements(List<AssetInput> rawGridElements) {
8484

8585
/* init sets */
8686
this.nodes =
87-
rawGridElements.parallelStream()
87+
rawGridElements
88+
.parallelStream()
8889
.filter(gridElement -> gridElement instanceof NodeInput)
8990
.map(nodeInput -> (NodeInput) nodeInput)
9091
.collect(Collectors.toSet());
9192
this.lines =
92-
rawGridElements.parallelStream()
93+
rawGridElements
94+
.parallelStream()
9395
.filter(gridElement -> gridElement instanceof LineInput)
9496
.map(lineInput -> (LineInput) lineInput)
9597
.collect(Collectors.toSet());
9698
this.transformer2Ws =
97-
rawGridElements.parallelStream()
99+
rawGridElements
100+
.parallelStream()
98101
.filter(gridElement -> gridElement instanceof Transformer2WInput)
99102
.map(trafo2wInput -> (Transformer2WInput) trafo2wInput)
100103
.collect(Collectors.toSet());
101104
this.transformer3Ws =
102-
rawGridElements.parallelStream()
105+
rawGridElements
106+
.parallelStream()
103107
.filter(gridElement -> gridElement instanceof Transformer3WInput)
104108
.map(trafo3wInput -> (Transformer3WInput) trafo3wInput)
105109
.collect(Collectors.toSet());
106110
this.switches =
107-
rawGridElements.parallelStream()
111+
rawGridElements
112+
.parallelStream()
108113
.filter(gridElement -> gridElement instanceof SwitchInput)
109114
.map(switchInput -> (SwitchInput) switchInput)
110115
.collect(Collectors.toSet());
111116
this.measurementUnits =
112-
rawGridElements.parallelStream()
117+
rawGridElements
118+
.parallelStream()
113119
.filter(gridElement -> gridElement instanceof MeasurementUnitInput)
114120
.map(measurementUnitInput -> (MeasurementUnitInput) measurementUnitInput)
115121
.collect(Collectors.toSet());

src/main/java/edu/ie3/datamodel/models/input/container/SystemParticipants.java

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,52 +106,62 @@ public SystemParticipants(List<SystemParticipantInput> systemParticipants) {
106106

107107
/* init sets */
108108
this.bmPlants =
109-
systemParticipants.parallelStream()
109+
systemParticipants
110+
.parallelStream()
110111
.filter(gridElement -> gridElement instanceof BmInput)
111112
.map(bmInput -> (BmInput) bmInput)
112113
.collect(Collectors.toSet());
113114
this.chpPlants =
114-
systemParticipants.parallelStream()
115+
systemParticipants
116+
.parallelStream()
115117
.filter(gridElement -> gridElement instanceof ChpInput)
116118
.map(chpInput -> (ChpInput) chpInput)
117119
.collect(Collectors.toSet());
118120
this.evCS =
119-
systemParticipants.parallelStream()
121+
systemParticipants
122+
.parallelStream()
120123
.filter(gridElement -> gridElement instanceof EvcsInput)
121124
.map(evcsInput -> (EvcsInput) evcsInput)
122125
.collect(Collectors.toSet());
123126
this.evs =
124-
systemParticipants.parallelStream()
127+
systemParticipants
128+
.parallelStream()
125129
.filter(gridElement -> gridElement instanceof EvInput)
126130
.map(evInput -> (EvInput) evInput)
127131
.collect(Collectors.toSet());
128132
this.fixedFeedIns =
129-
systemParticipants.parallelStream()
133+
systemParticipants
134+
.parallelStream()
130135
.filter(gridElement -> gridElement instanceof FixedFeedInInput)
131136
.map(fixedFeedInInpu -> (FixedFeedInInput) fixedFeedInInpu)
132137
.collect(Collectors.toSet());
133138
this.heatPumps =
134-
systemParticipants.parallelStream()
139+
systemParticipants
140+
.parallelStream()
135141
.filter(gridElement -> gridElement instanceof HpInput)
136142
.map(hpInput -> (HpInput) hpInput)
137143
.collect(Collectors.toSet());
138144
this.loads =
139-
systemParticipants.parallelStream()
145+
systemParticipants
146+
.parallelStream()
140147
.filter(gridElement -> gridElement instanceof LoadInput)
141148
.map(loadInput -> (LoadInput) loadInput)
142149
.collect(Collectors.toSet());
143150
this.pvPlants =
144-
systemParticipants.parallelStream()
151+
systemParticipants
152+
.parallelStream()
145153
.filter(gridElement -> gridElement instanceof PvInput)
146154
.map(pvInput -> (PvInput) pvInput)
147155
.collect(Collectors.toSet());
148156
this.storages =
149-
systemParticipants.parallelStream()
157+
systemParticipants
158+
.parallelStream()
150159
.filter(gridElement -> gridElement instanceof StorageInput)
151160
.map(storageInput -> (StorageInput) storageInput)
152161
.collect(Collectors.toSet());
153162
this.wecPlants =
154-
systemParticipants.parallelStream()
163+
systemParticipants
164+
.parallelStream()
155165
.filter(gridElement -> gridElement instanceof WecInput)
156166
.map(wecInput -> (WecInput) wecInput)
157167
.collect(Collectors.toSet());

src/main/java/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ private ChargingPointTypeUtils() {
142142
Stream.concat(
143143
Stream.of(type.getId().toLowerCase()),
144144
type.getSynonymousIds().stream().map(String::toLowerCase))
145-
.collect(Collectors.toMap(Function.identity(), v -> type))
146-
.entrySet()
145+
.collect(Collectors.toMap(Function.identity(), v -> type)).entrySet()
147146
.stream())
148147
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));
149148

src/main/java/edu/ie3/datamodel/utils/ContainerNodeUpdateUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ private static SystemParticipants updateSystemParticipantsWithNodes(
207207
SystemParticipants systemParticipants, Map<NodeInput, NodeInput> oldToNewNodes) {
208208

209209
List<SystemParticipantInput> sysParts =
210-
systemParticipants.allEntitiesAsList().parallelStream()
210+
systemParticipants
211+
.allEntitiesAsList()
212+
.parallelStream()
211213
.map(
212214
sysPart -> {
213215
if (oldToNewNodes.containsKey(sysPart.getNode())) {

0 commit comments

Comments
 (0)