File tree Expand file tree Collapse file tree 4 files changed +6
-133
lines changed
main/java/edu/ie3/datamodel
test/groovy/edu/ie3/datamodel/utils Expand file tree Collapse file tree 4 files changed +6
-133
lines changed Original file line number Diff line number Diff line change 55*/
66package edu .ie3 .datamodel .io .source .csv ;
77
8- import static edu .ie3 .datamodel .utils .CollectionUtils .groupBy ;
98import static java .util .Collections .emptySet ;
109
1110import edu .ie3 .datamodel .exceptions .SourceException ;
2221import edu .ie3 .datamodel .utils .Try ;
2322import java .nio .file .Path ;
2423import java .util .*;
24+ import java .util .stream .Collectors ;
2525
2626/** Convenience class for cases where all used data comes from CSV sources */
2727public class CsvThermalGridSource {
@@ -85,9 +85,11 @@ public static List<ThermalGrid> read(
8585 // filtered and thrown before
8686
8787 Map <ThermalBusInput , Set <ThermalHouseInput >> houseInputs =
88- groupBy (houses .getOrThrow (), ThermalUnitInput ::getThermalBus );
88+ houses .getOrThrow ().stream ()
89+ .collect (Collectors .groupingBy (ThermalUnitInput ::getThermalBus , Collectors .toSet ()));
8990 Map <ThermalBusInput , Set <ThermalStorageInput >> storageInputs =
90- groupBy (storages .getOrThrow (), ThermalUnitInput ::getThermalBus );
91+ storages .getOrThrow ().stream ()
92+ .collect (Collectors .groupingBy (ThermalUnitInput ::getThermalBus , Collectors .toSet ()));
9193
9294 return buses .values ().stream ()
9395 .map (
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 88import static java .util .stream .Collectors .partitioningBy ;
99
1010import edu .ie3 .datamodel .exceptions .FailureException ;
11- import edu .ie3 .datamodel .exceptions .SourceException ;
1211import edu .ie3 .datamodel .exceptions .TryException ;
1312import java .util .*;
1413import java .util .function .Function ;
@@ -594,7 +593,7 @@ public int hashCode() {
594593 */
595594 @ FunctionalInterface
596595 public interface TrySupplier <T , E extends Exception > {
597- T get () throws E , SourceException ;
596+ T get () throws E ;
598597 }
599598
600599 /**
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments