@startuml

note "Assuming all classes to implement \nthe abstract methods of their interfaces\n\n" as generalNotes

abstract class EntitySource {
    + void validate() throws ValidationException
}

EntitySource <|-- EnergyManagementSource
EntitySource <|-- GraphicSource
EntitySource <|-- IdCoordinateSource
IdCoordinateSource <|-- CsvIdCoordinateSource
IdCoordinateSource <|-- SqlIdCoordinateSource
EntitySource <|-- RawGridSource
EntitySource <|-- ResultEntitySource
EntitySource <|-- SystemParticipantSource
EntitySource <|-- ThermalSource
EntitySource <|-- TimeSeriesMappingSource
TimeSeriesMappingSource <|-- CsvTimeSeriesMappingSource
TimeSeriesMappingSource <|-- SqlTimeSeriesMappingSource
EntitySource <|-- TimeSeriesSource
TimeSeriesSource <|-- CsvTimeSeriesSource
TimeSeriesSource <|-- SqlTimeSeriesSource
EntitySource <|-- TypeSource
EntitySource <|-- WeatherSource
WeatherSource <|-- CouchbaseWeatherSource
WeatherSource <|-- CsvWeatherSource
WeatherSource <|-- InfluxDbWeatherSource
WeatherSource <|-- SqlWeatherSource

class EnergyManagementSource {
    - TypeSource typeSource
    - EmInputFactory emInputFactory
    + EnergyManagementSource(TypeSource, DataSource)
    + Map<UUID, EmInput> getEmUnits() throws SourceException
    + Map<UUID, EmInput> getEmUnits(Map<UUID, OperatorInput>) throws SourceException
}

class GraphicSource {
    - TypeSource typeSource
    - RawGridSource rawGridSource
    - LineGraphicInputFactory lineGraphicInputFactory
    - NodeGraphicInputFactory nodeGraphicInputFactory
    + GraphicSource(TypeSource, RawGridSource, DataSource)
    + GraphicElements getGraphicElements() throws SourceException
    + GraphicElements getGraphicElements(Map<UUID, NodeInput>, Map<UUID, LineInput>) throws SourceException
    + Set<NodeGraphicInput> getNodeGraphicInput() throws SourceException
    + Set<NodeGraphicInput> getNodeGraphicInput(Map<UUID, NodeInput>) throws SourceException
    + Set<LineGraphicInput> getLineGraphicInput() throws SourceException
    + Set<LineGraphicInput> getLineGraphicInput(Map<UUID, LineInput>) throws SourceException
}

abstract class IdCoordinateSource {
    + Optional<Set<String>> getSourceFields() throws SourceException
    + Optional<Point> getCoordinate(int)
    + Collection<Point> getCoordinates(int[])
    + Optional<Integer> getId(Point)
    + Collection<Point> getAllCoordinates()
    + List<CoordinateDistance> getNearestCoordinates(Point, int)
    + List<CoordinateDistance> getClosestCoordinates(Point, int, ComparableQuantity<Length>)
    + List<CoordinateDistance> calculateCoordinateDistances(Point, int, Collection<Point>)
    + List<CoordinateDistance> findCornerPoints(Point, ComparableQuantity<Length>)
    + List<CoordinateDistance> findCornerPoints(Point, Collection<CoordinateDistance>)
}

class CsvIdCoordinateSource {
      - Map<Integer, Point> idToCoordinate;
      - Map<Point, Integer> coordinateToId;
      - CsvDataSource dataSource;
      - IdCoordinateFactory factory;
      + CsvIdCoordinateSource(IdCoordinateFactory, CsvDataSource) throws SourceException
      + int getCoordinateCount()
}

class SqlIdCoordinateSource {
    - SqlDataSource dataSource
    - SqlIdCoordinateFactory factory
    + SqlIdCoordinateSource(SqlIdCoordinateFactory, String, SqlDataSource)
}

class RawGridSource {
    - TypeSource typeSource
    - NodeInputFactory nodeInputFactory
    - LineInputFactory lineInputFactory
    - Transformer2WInputFactory transformer2WInputFactory
    - Transformer3WInputFactory transformer3WInputFactory
    - SwitchInputFactory switchInputFactory
    - MeasurementUnitInputFactory measurementUnitInputFactory
    + RawGridSource(TypeSource typeSource, DataSource dataSource)
    + RawGridElements getGridData() throws SourceException
    + RawGridElements getGridData(Map<UUID, OperatorInput>, Map<UUID, NodeInput>, Map<UUID, LineInput>) throws SourceException
    + Map<UUID, NodeInput> getNodes() throws SourceException
    + Map<UUID, NodeInput> getNodes(Map<UUID, OperatorInput>) throws SourceException
    + Map<UUID, LineInput> getLines() throws SourceException
    + Map<UUID, LineInput> getLines(Map<UUID, OperatorInput>, Map<UUID, NodeInput>, Set<LineTypeInput>) throws SourceException
    + Set<Transformer2WInput> get2WTransformers() throws SourceException
    + Set<Transformer2WInput> get2WTransformers(Map<UUID, OperatorInput>, Map<UUID, NodeInput>, Set<Transformer2WTypeInput>) throws SourceException
    + Set<Transformer3WInput> get3WTransformers() throws SourceException
    + Set<Transformer3WInput> get3WTransformers(Map<UUID, OperatorInput>, Map<UUID, NodeInput>, Set<Transformer3WTypeInput>) throws SourceException
    + Set<SwitchInput> getSwitches() throws SourceException
    + Set<SwitchInput> getSwitches(Map<UUID, OperatorInput>, Map<UUID, NodeInput>) throws SourceException
    + Set<MeasurementUnitInput> getMeasurementUnits() throws SourceException
    + Set<MeasurementUnitInput> getMeasurementUnits(Map<UUID, OperatorInput>, Map<UUID, NodeInput>) throws SourceException
}

class ResultEntitySource {
    - SystemParticipantResultFactory systemParticipantResultFactory
    - ThermalResultFactory thermalResultFactory
    - SwitchResultFactory switchResultFactory
    - NodeResultFactory nodeResultFactory
    - ConnectorResultFactory connectorResultFactory
    - CongestionResultFactory congestionResultFactory
    - FlexOptionsResultFactory flexOptionsResultFactory
    + ResultEntitySource(DataSource)
    + Set<NodeResult> getNodeResults() throws SourceException
    + Set<SwitchResult> getSwitchResults() throws SourceException
    + Set<LineResult> getLineResults() throws SourceException
    + Set<Transformer2WResult> getTransformer2WResultResults() throws SourceException
    + Set<Transformer3WResult> getTransformer3WResultResults() throws SourceException
    + Set<FlexOptionsResult> getFlexOptionsResults() throws SourceException
    + Set<LoadResult> getLoadResults() throws SourceException
    + Set<PvResult> getPvResults() throws SourceException
    + Set<FixedFeedInResult> getFixedFeedInResults() throws SourceException
    + Set<BmResult> getBmResults() throws SourceException
    + Set<ChpResult> getChpResults() throws SourceException
    + Set<WecResult> getWecResults() throws SourceException
    + Set<StorageResult> getStorageResults() throws SourceException
    + Set<EvcsResult> getEvcsResults() throws SourceException
    + Set<EvResult> getEvResults() throws SourceException
    + Set<HpResult> getHpResults() throws SourceException
    + Set<AcResult> getAcResults() throws SourceException
    + Set<CylindricalStorageResult> getCylindricalStorageResult() throws SourceException
    + Set<DomesticHotStorageResult> getDomesticHotWaterStorageResult() throws SourceException
    + Set<ThermalHouseResult> getThermalHouseResults() throws SourceException
    + Set<EmResult> getEmResults() throws SourceException
    + Set<CongestionResult> getCongestionResults() throws SourceException
}

class SystemParticipantSource{
    - TypeSource typeSource
    - RawGridSource rawGridSource
    - ThermalSource thermalSource
    - EnergyManagementSource energyManagementSource
    - AcInputFactory acInputFactory
    - BmInputFactory bmInputFactory
    - ChpInputFactory chpInputFactory
    - EvInputFactory evInputFactory
    - FixedFeedInInputFactory fixedFeedInInputFactory
    - HpInputFactory hpInputFactory
    - LoadInputFactory loadInputFactory
    - PvInputFactory pvInputFactory
    - StorageInputFactory storageInputFactory
    - WecInputFactory wecInputFactory
    - EvcsInputFactory evcsInputFactory
    + SystemParticipantSource(TypeSource, ThermalSource, RawGridSource, EnergyManagementSource, DataSource)
    + SystemParticipants getSystemParticipants() throws SourceException
    + SystemParticipants getSystemParticipants(Map<UUID, OperatorInput>, Map<UUID, NodeInput>) throws SourceException
    + Set<AcInput> getAirConditions() throws SourceException
    + Set<AcInput> getAirConditions(Map<UUID, OperatorInput>, Map<UUID, NodeInput>, Set<AcTypeInput>) throws SourceException
    + Set<BmInput> getBmPlants() throws SourceException
    + Set<BmInput> getBmPlants(Map<UUID, OperatorInput>, Map<UUID, NodeInput>, Set<BmTypeInput>) throws SourceException
    + Set<ChpInput> getChpPlants() throws SourceException
    + Set<ChpInput> getChpPlants(Map<UUID, OperatorInput>, Map<UUID, NodeInput>, Set<ChpTypeInput>, Map<UUID, ThermalBusInput>, Set<ThermalStorageInput>) throws SourceException
    + Set<EvInput> getEvs() throws SourceException
    + Set<EvInput> getEvs(Map<UUID, OperatorInput>, Map<UUID, NodeInput>, Set<EvTypeInput>) throws SourceException
    + Set<EvcsInput> getEvcs() throws SourceException
    + Set<EvcsInput> getEvcs(Map<UUID, OperatorInput>, Map<UUID, NodeInput>) throws SourceException
    + Set<FixedFeedInInput> getFixedFeedIns() throws SourceException
    + Set<FixedFeedInInput> getFixedFeedIns(Map<UUID, OperatorInput>, Map<UUID, NodeInput>) throws SourceException
    + Set<HpInput> getHeatPumps() throws SourceException
    + Set<HpInput> getHeatPumps(Map<UUID, OperatorInput>, Map<UUID, NodeInput>, Set<HpTypeInput>, Map<UUID, ThermalBusInput>) throws SourceException
    + Set<LoadInput> getLoads() throws SourceException
    + Set<LoadInput> getLoads(Map<UUID, OperatorInput>, Map<UUID, NodeInput>) throws SourceException
    + Set<PvInput> getPvPlants() throws SourceException
    + Set<PvInput> getPvPlants(Map<UUID, OperatorInput>, Map<UUID, NodeInput>) throws SourceException
    + Set<StorageInput> getStorages() throws SourceException
    + Set<StorageInput> getStorages(Map<UUID, OperatorInput>, Map<UUID, NodeInput>, Set<StorageTypeInput>) throws SourceException
    + Set<WecInput> getWecPlants() throws SourceException
    + Set<WecInput> getWecPlants(Map<UUID, OperatorInput>, Map<UUID, NodeInput>, Set<WecTypeInput>) throws SourceException
}

class ThermalSource {
    - TypeSource typeSource
    - ThermalBusInputFactory thermalBusInputFactory
    - CylindricalStorageInputFactory cylindricalStorageInputFactory
    - DomesticHotWaterStorageInputFactory domesticHotWaterStorageInputFactory
    - ThermalHouseInputFactory thermalHouseInputFactory
    + ThermalSource(TypeSource, DataSource)
    + Map<UUID, ThermalBusInput> getThermalBuses() throws SourceException
    + Map<UUID, ThermalBusInput> getThermalBuses(Map<UUID, OperatorInput>) throws SourceException
    + Map<UUID, ThermalStorageInput> getThermalStorages() throws SourceException
    + Map<UUID, ThermalStorageInput> getThermalStorages(Map<UUID, OperatorInput>, Map<UUID, ThermalBusInput>) throws SourceException
    + Map<UUID, ThermalHouseInput> getThermalHouses() throws SourceException
    + Map<UUID, ThermalHouseInput> getThermalHouses(Map<UUID, OperatorInput>, Map<UUID, ThermalBusInput>) throws SourceException
    + Set<CylindricalStorageInput> getCylindricalStorages() throws SourceException
    + Set<CylindricalStorageInput> getCylindricalStorages(Map<UUID, OperatorInput>, Map<UUID, ThermalBusInput>) throws SourceException
    + Set<DomesticHotWaterStorageInput> getDomesticHotWaterStorages() throws SourceException
    + Set<DomesticHotWaterStorageInput> getDomesticHotWaterStorages(Map<UUID, OperatorInput>, Map<UUID, ThermalBusInput>) throws SourceException
}

abstract class TimeSeriesMappingSource {
    - TimeSeriesMappingFactory mappingFactory
    + Map<UUID, UUID> getMapping() throws SourceException
    + Optional<UUID> getTimeSeriesUuid(UUID) throws SourceException
    + Stream<Map<String, String>> getMappingSourceData() throws SourceException
    + Optional<Set<String>> getSourceFields() throws SourceException
}

class CsvTimeSeriesMappingSource {
    - CsvDataSource dataSource
    + CsvTimeSeriesMappingSource(String, Path, FileNamingStrategy)
}

class SqlTimeSeriesMappingSource {
    - EntityPersistenceNamingStrategy entityPersistenceNamingStrategy
    - SqlDataSource dataSource
    + SqlTimeSeriesMappingSource(SqlConnector, String, EntityPersistenceNamingStrategy)
}

abstract class TimeSeriesSource {
    - Class<V> valueClass
    - TimeBasedSimpleValueFactory<V> valueFactory
    + TimeSeriesSource(Class<V>, TimeBasedSimpleValueFactory<V>)
    + IndividualTimeSeries<V> getTimeSeries()
    + IndividualTimeSeries<V> getTimeSeries(ClosedInterval<ZonedDateTime>) throws SourceException
    + Optional<V> getValue(ZonedDateTime) throws SourceException
}

class CsvTimeSeriesSource {
    - IndividualTimeSeries<V> timeSeries
    - CsvDataSource dataSource
    - Path filePath
    + {static} CsvTimeSeriesSource<? extends Value> getSource(String, Path, FileNamingStrategy, CsvIndividualTimeSeriesMetaInformation)
    + CsvTimeSeriesSource(String, Path, FileNamingStrategy, UUID, Path, Class<V>, TimeBasedSimpleValueFactory<V>)
}

class SqlTimeSeriesSource {
    - SqlDataSource dataSource
    - UUID timeSeriesUuid
    + SqlTimeSeriesSource(SqlDataSource, UUID, Class<V>, TimeBasedSimpleValueFactory<V>)
    + SqlTimeSeriesSource(SqlConnector, String, DatabaseNamingStrategy, UUID, Class<V>, TimeBasedSimpleValueFactory<V>)
    + SqlTimeSeriesSource<? extends Value> createSource(SqlConnector, String, DatabaseNamingStrategy, IndividualTimeSeriesMetaInformation) throws SourceException
}

class TypeSource {
    - OperatorInputFactory operatorInputFactory
    - Transformer2WTypeInputFactory transformer2WTypeInputFactory
    - LineTypeInputFactory lineTypeInputFactory
    - Transformer3WTypeInputFactory transformer3WTypeInputFactory
    - SystemParticipantTypeInputFactory systemParticipantTypeInputFactory
    - DataSource dataSource
    + TypeSource(DataSource)
    + Map<UUID, Transformer2WTypeInput> getTransformer2WTypes() throws SourceException
    + Map<UUID, Transformer3WTypeInput> getTransformer3WTypes() throws SourceException
    + Map<UUID, OperatorInput> getOperators() throws SourceException
    + Map<UUID, LineTypeInput> getLineTypes() throws SourceException
    + Map<UUID, BmTypeInput> getBmTypes() throws SourceException
    + Map<UUID, ChpTypeInput> getChpTypes() throws SourceException
    + Map<UUID, HpTypeInput> getHpTypes() throws SourceException
    + Map<UUID, StorageTypeInput> getStorageTypes() throws SourceException
    + Map<UUID, WecTypeInput> getWecTypes() throws SourceException
    + Map<UUID, EvTypeInput> getEvTypes() throws SourceException
}

abstract class WeatherSource {
    - TimeBasedWeatherValueFactory weatherFactory
    - IdCoordinateSource idCoordinateSource
    + WeatherSource(IdCoordinateSource, TimeBasedWeatherValueFactory)
    + Optional<Set<String>> getSourceFields() throws SourceException
    + Map<Point, IndividualTimeSeries<WeatherValue>> getWeather(ClosedInterval<ZonedDateTime>) throws SourceException
    + Map<Point, IndividualTimeSeries<WeatherValue>> getWeather(ClosedInterval<ZonedDateTime>, Collection<Point>) throws SourceException
    + Optional<TimeBasedValue<WeatherValue>> getWeather(ZonedDateTime, Point) throws SourceException
}

class CouchbaseWeatherSource {
    - CouchbaseConnector connector
    + CouchbaseWeatherSource(CouchbaseConnector, IdCoordinateSource, String, TimeBasedWeatherValueFactory, String)
    + CouchbaseWeatherSource(CouchbaseConnector, IdCoordinateSource, String, String, TimeBasedWeatherValueFactory, String)
}

class CsvWeatherSource {
    - CsvDataSource dataSource
    - Map<Point, IndividualTimeSeries<WeatherValue>> coordinateToTimeSeries
    + CsvWeatherSource(String, Path, FileNamingStrategy, IdCoordinateSource, TimeBasedWeatherValueFactory) throws SourceException
}

class InfluxDbWeatherSource {
    - InfluxDbConnector connector
    + InfluxDbWeatherSource(InfluxDbConnector, IdCoordinateSource, TimeBasedWeatherValueFactory)
    + IndividualTimeSeries<WeatherValue> getWeather(ClosedInterval<ZonedDateTime>, Point)
}

class SqlWeatherSource {
    - SqlDataSource dataSource
    + SqlWeatherSource(SqlConnector, IdCoordinateSource, String, String, TimeBasedWeatherValueFactory)
}

@enduml