-
Notifications
You must be signed in to change notification settings - Fork 5
/
DataSource.java
29 lines (25 loc) · 989 Bytes
/
DataSource.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
/*
* © 2023. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/
package edu.ie3.datamodel.io.source;
import edu.ie3.datamodel.exceptions.SourceException;
import edu.ie3.datamodel.models.Entity;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Stream;
/** Interface that include functionalities for data sources in the database table, csv file etc. */
public interface DataSource {
/**
* Method to retrieve the fields found in the source.
*
* @param entityClass class of the source
* @return an option for the found fields
*/
Optional<Set<String>> getSourceFields(Class<? extends Entity> entityClass) throws SourceException;
/** Creates a stream of maps that represent the rows in the database */
Stream<Map<String, String>> getSourceData(Class<? extends Entity> entityClass)
throws SourceException;
}