-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding EvcsLocationType to EcsInput, adapting factories and tests
- Loading branch information
1 parent
dcc200d
commit 9216532
Showing
11 changed files
with
166 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/edu/ie3/datamodel/models/input/system/type/evcslocation/EvcsLocationType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* © 2021. TU Dortmund University, | ||
* Institute of Energy Systems, Energy Efficiency and Energy Economics, | ||
* Research group Distribution grid planning and operation | ||
*/ | ||
package edu.ie3.datamodel.models.input.system.type.evcslocation; | ||
|
||
public enum EvcsLocationType { | ||
HOME, | ||
WORK, | ||
CUSTOMER_PARKING, | ||
STREET, | ||
CHARGING_HUB_TOWN, | ||
CHARGING_HUB_HIGHWAY | ||
} |
30 changes: 30 additions & 0 deletions
30
...n/java/edu/ie3/datamodel/models/input/system/type/evcslocation/EvcsLocationTypeUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* © 2021. TU Dortmund University, | ||
* Institute of Energy Systems, Energy Efficiency and Energy Economics, | ||
* Research group Distribution grid planning and operation | ||
*/ | ||
package edu.ie3.datamodel.models.input.system.type.evcslocation; | ||
|
||
import edu.ie3.datamodel.exceptions.ParsingException; | ||
import java.util.HashMap; | ||
|
||
public class EvcsLocationTypeUtils { | ||
|
||
private static final HashMap<String, EvcsLocationType> nameToType = initMap(); | ||
|
||
private static HashMap<String, EvcsLocationType> initMap() { | ||
final HashMap<String, EvcsLocationType> map = new HashMap<>(EvcsLocationType.values().length); | ||
for (EvcsLocationType type : EvcsLocationType.values()) map.put(type.name(), type); | ||
|
||
return map; | ||
} | ||
|
||
private EvcsLocationTypeUtils() { | ||
throw new IllegalStateException("This is a factory class. Don't try to instantiate it."); | ||
} | ||
|
||
public static EvcsLocationType parse(String parsableString) throws ParsingException { | ||
if (nameToType.containsKey(parsableString)) return nameToType.get(parsableString); | ||
else throw new ParsingException("EvcsLocationType '" + parsableString + "' does not exist."); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.