Class EntityPersistenceNamingStrategy

java.lang.Object
edu.ie3.datamodel.io.naming.EntityPersistenceNamingStrategy

public class EntityPersistenceNamingStrategy extends Object
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 Details

    • logger

      protected static final org.slf4j.Logger logger
    • individualTimeSeriesPattern

      protected final Pattern individualTimeSeriesPattern
      Pattern to identify individual time series in this instance of the naming strategy (takes care of prefix and suffix)
    • loadProfileTimeSeriesPattern

      protected final Pattern 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

      public EntityPersistenceNamingStrategy(String prefix)
      Constructor for building the names of the data sinks
      Parameters:
      prefix - Prefix of the data sinks
    • EntityPersistenceNamingStrategy

      public EntityPersistenceNamingStrategy(String prefix, String suffix)
      Constructor for building the names of the data sinks
      Parameters:
      prefix - Prefix of the data sinks
      suffix - Suffixes of the data sinks
  • Method Details

    • getLoadProfileTimeSeriesPattern

      public Pattern getLoadProfileTimeSeriesPattern()
    • getIndividualTimeSeriesPattern

      public Pattern 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.
      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
    • individualTimesSeriesMetaInformation

      public IndividualTimeSeriesMetaInformation individualTimesSeriesMetaInformation(String sourceName)
      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.
      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
    • loadProfileTimesSeriesMetaInformation

      public LoadProfileTimeSeriesMetaInformation loadProfileTimesSeriesMetaInformation(String fileName)
      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

      public Optional<String> getEntityName(Class<? extends UniqueEntity> cls)
      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

      public Optional<String> getInputEntityName(Class<? extends InputEntity> cls)
      Get the name for all InputEntitys
      Parameters:
      cls - Targeted class of the given entity
      Returns:
      The entity name
    • getResultEntityName

      public Optional<String> getResultEntityName(Class<? extends ResultEntity> resultEntityClass)
      Get the entity name for all ResultEntitys
      Parameters:
      resultEntityClass - the result entity class an entity name string should be generated from
      Returns:
      the entity name string
    • getTypeEntityName

      public Optional<String> getTypeEntityName(Class<? extends AssetTypeInput> typeClass)
      Get the entity name for all AssetTypeInputs
      Parameters:
      typeClass - the asset type class an entity name string should be generated from
      Returns:
      the entity name string
    • getAssetInputEntityName

      public Optional<String> getAssetInputEntityName(Class<? extends AssetInput> assetInputClass)
      Get the entity name for all AssetInputs
      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 all CharacteristicInputs
      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 all RandomLoadParameters
      Parameters:
      randomLoadParamClass - the random load parameters class an entity name string should be generated from
      Returns:
      the entity name string
    • getGraphicsInputEntityName

      public Optional<String> getGraphicsInputEntityName(Class<? extends GraphicInput> graphicClass)
      Get the entity name for all GraphicInputs
      Parameters:
      graphicClass - the graphic input class an entity name string should be generated from
      Returns:
      the entity name string
    • getOperatorInputEntityName

      public Optional<String> getOperatorInputEntityName(Class<? extends OperatorInput> operatorClass)
      Get the entity name for all OperatorInputs
      Parameters:
      operatorClass - the asset input class an entity name string should be generated from
      Returns:
      the entity name string
    • getTimeSeriesMappingEntityName

      public Optional<String> getTimeSeriesMappingEntityName()
      Get the entity name for time series mapping
      Returns:
      The entity name string
    • getEntityName

      public <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.
      Type Parameters:
      T - Type of the time series
      E - Type of the entry in the time series
      V - 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

      public String getIdCoordinateEntityName()
      Get the entity name for coordinates
      Returns:
      the entity name string