Package edu.ie3.datamodel.io.naming
Class EntityPersistenceNamingStrategy
java.lang.Object
edu.ie3.datamodel.io.naming.EntityPersistenceNamingStrategy
Provides an easy to use standard way to name files, tables or any other persistent representation
of models. Normal use cases are e.g., I/O operations with .csv files or databases.
- Since:
- 03.02.20
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PatternPattern to identify individual time series in this instance of the naming strategy (takes care of prefix and suffix)protected final PatternPattern to identify load profile time series in this instance of the naming strategy (takes care of prefix and suffix)protected static final org.slf4j.Logger -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for building the names of the data sinks without provided entities with prefix and suffixConstructor for building the names of the data sinksEntityPersistenceNamingStrategy(String prefix, String suffix) Constructor for building the names of the data sinks -
Method Summary
Modifier and TypeMethodDescriptionextractIndividualTimesSeriesMetaInformation(String sourceName) Deprecated, for removal: This API element is subject to removal in a future version.since 3.0.Deprecated, for removal: This API element is subject to removal in a future version.since 3.0.getAssetCharacteristicsEntityName(Class<? extends CharacteristicInput> assetCharClass) Get the entity name for allCharacteristicInputsgetAssetInputEntityName(Class<? extends AssetInput> assetInputClass) Get the entity name for allAssetInputsgetEntityName(Class<? extends UniqueEntity> cls) Returns the name of the entity, that should be used for persistence.<T extends TimeSeries<E,V>, E extends TimeSeriesEntry<V>, V extends Value>
Optional<String>getEntityName(T timeSeries) Builds a file name (and only the file name without any directories and extension) of the given information.getGraphicsInputEntityName(Class<? extends GraphicInput> graphicClass) Get the entity name for allGraphicInputsGet the entity name for coordinatesgetInputEntityName(Class<? extends InputEntity> cls) Get the name for allInputEntitysgetOperatorInputEntityName(Class<? extends OperatorInput> operatorClass) Get the entity name for allOperatorInputsgetRandomLoadParametersEntityName(Class<? extends RandomLoadParameters> randomLoadParamClass) Get the entity name for allRandomLoadParametersgetResultEntityName(Class<? extends ResultEntity> resultEntityClass) Get the entity name for allResultEntitysGet the entity name for time series mappinggetTypeEntityName(Class<? extends AssetTypeInput> typeClass) Get the entity name for allAssetTypeInputsindividualTimesSeriesMetaInformation(String sourceName) Extracts meta information from a valid source name for an individual time seriesloadProfileTimesSeriesMetaInformation(String fileName) Extracts meta information from a valid file name for a load profile time series
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
individualTimeSeriesPattern
Pattern to identify individual time series in this instance of the naming strategy (takes care of prefix and suffix) -
loadProfileTimeSeriesPattern
Pattern to identify load profile time series in this instance of the naming strategy (takes care of prefix and suffix)
-
-
Constructor Details
-
EntityPersistenceNamingStrategy
public EntityPersistenceNamingStrategy()Constructor for building the names of the data sinks without provided entities with prefix and suffix -
EntityPersistenceNamingStrategy
Constructor for building the names of the data sinks- Parameters:
prefix- Prefix of the data sinks
-
EntityPersistenceNamingStrategy
Constructor for building the names of the data sinks- Parameters:
prefix- Prefix of the data sinkssuffix- Suffixes of the data sinks
-
-
Method Details
-
getLoadProfileTimeSeriesPattern
-
getIndividualTimeSeriesPattern
-
extractIndividualTimesSeriesMetaInformation
@Deprecated(since="3.0", forRemoval=true) public IndividualTimeSeriesMetaInformation extractIndividualTimesSeriesMetaInformation(String sourceName) Deprecated, for removal: This API element is subject to removal in a future version.since 3.0. UseindividualTimesSeriesMetaInformation(String)insteadExtracts meta information from a valid source name for an individual time series- Parameters:
sourceName- Name of the source to extract information from, e.g. file name or SQL table name- Returns:
- Meta information form individual time series source name
-
individualTimesSeriesMetaInformation
Extracts meta information from a valid source name for an individual time series- Parameters:
sourceName- Name of the source to extract information from, e.g. file name or SQL table name- Returns:
- Meta information form individual time series source name
-
extractLoadProfileTimesSeriesMetaInformation
@Deprecated(since="3.0", forRemoval=true) public LoadProfileTimeSeriesMetaInformation extractLoadProfileTimesSeriesMetaInformation(String fileName) Deprecated, for removal: This API element is subject to removal in a future version.since 3.0. UseloadProfileTimesSeriesMetaInformation(String)insteadExtracts meta information from a valid file name for a load profile time series- Parameters:
fileName- File name to extract information from- Returns:
- Meta information form load profile time series file name
-
loadProfileTimesSeriesMetaInformation
Extracts meta information from a valid file name for a load profile time series- Parameters:
fileName- File name to extract information from- Returns:
- Meta information form load profile time series file name
-
getEntityName
Returns the name of the entity, that should be used for persistence.- Parameters:
cls- Targeted class of the given entity- Returns:
- The name of the entity
-
getInputEntityName
Get the name for allInputEntitys- Parameters:
cls- Targeted class of the given entity- Returns:
- The entity name
-
getResultEntityName
Get the entity name for allResultEntitys- Parameters:
resultEntityClass- the result entity class an entity name string should be generated from- Returns:
- the entity name string
-
getTypeEntityName
Get the entity name for allAssetTypeInputs- Parameters:
typeClass- the asset type class an entity name string should be generated from- Returns:
- the entity name string
-
getAssetInputEntityName
Get the entity name for allAssetInputs- Parameters:
assetInputClass- the asset input class an entity name string should be generated from- Returns:
- the entity name string
-
getAssetCharacteristicsEntityName
public Optional<String> getAssetCharacteristicsEntityName(Class<? extends CharacteristicInput> assetCharClass) Get the entity name for allCharacteristicInputs- Parameters:
assetCharClass- the asset characteristics class an entity name string should be generated from- Returns:
- the entity name string
-
getRandomLoadParametersEntityName
public Optional<String> getRandomLoadParametersEntityName(Class<? extends RandomLoadParameters> randomLoadParamClass) Get the entity name for allRandomLoadParameters- Parameters:
randomLoadParamClass- the random load parameters class an entity name string should be generated from- Returns:
- the entity name string
-
getGraphicsInputEntityName
Get the entity name for allGraphicInputs- Parameters:
graphicClass- the graphic input class an entity name string should be generated from- Returns:
- the entity name string
-
getOperatorInputEntityName
Get the entity name for allOperatorInputs- Parameters:
operatorClass- the asset input class an entity name string should be generated from- Returns:
- the entity name string
-
getTimeSeriesMappingEntityName
Get the entity name for time series mapping- Returns:
- The entity name string
-
getEntityName
public <T extends TimeSeries<E,V>, Optional<String> getEntityNameE extends TimeSeriesEntry<V>, V extends Value> (T timeSeries) Builds a file name (and only the file name without any directories and extension) of the given information.- Type Parameters:
T- Type of the time seriesE- Type of the entry in the time seriesV- Type of the value, that is carried by the time series entry- Parameters:
timeSeries- Time series to derive naming information from- Returns:
- A file name for this particular time series
-
getIdCoordinateEntityName
Get the entity name for coordinates- Returns:
- the entity name string
-