Record Class PersistenceDirectoryLayoutInstance

java.lang.Object
java.lang.Record
de.bsvrz.ars.ars.persistence.layout.PersistenceDirectoryLayoutInstance
Record Components:
layout - Verzeichnis-Layout
basePath - Dateisystem-Pfad, unter dem die Archivdaten liegen. Dies ist z. B. das konkrete Wochenverzeichnis.
simulationVariant - Simulationsvariante der Daten in diesem Verzeichnis

public record PersistenceDirectoryLayoutInstance(PersistenceDirectoryLayout layout, Path basePath, int simulationVariant) extends Record
Konkrete instanz eines PersistenceDirectoryLayout, welches sich an einer bestimmten Position im Dateisystem befindet.
  • Constructor Details

    • PersistenceDirectoryLayoutInstance

      public PersistenceDirectoryLayoutInstance(PersistenceDirectoryLayout layout, Path basePath, int simulationVariant)
      Creates an instance of a PersistenceDirectoryLayoutInstance record class.
      Parameters:
      layout - the value for the layout record component
      basePath - the value for the basePath record component
      simulationVariant - the value for the simulationVariant record component
  • Method Details

    • getContainerDirectory

      public IdContainerFileDir getContainerDirectory(BaseIndex<?> index) throws IndexException
      Ermittelt von einer Index-Datei im Dateisystem die Datenidentifikation
      Parameters:
      index - Index
      Returns:
      Datenidentifikation und Datenart
      Throws:
      IndexException - Fehler bei Abfrage
    • getContainerDirectory

      public IdContainerFileDir getContainerDirectory(Path containerDirectory) throws PersistenceException
      Ermittelt von einem Pfad im Dateisystem die Datenidentifikation und Datenart
      Parameters:
      containerDirectory - Containerdateien-Verzeichnis
      Returns:
      Datenidentifikation und Datenart
      Throws:
      PersistenceException - Fehler bei Abfrage
    • getPath

      @NotNull @Contract(pure=true) public Path getPath(ContainerDirectory containerDirectory)
      Gibt zu einem ContainerDirectory das zugehörige Verzeichnis zurück.
      Parameters:
      containerDirectory - Datenidentifikation und Archivdatenart, die das Containerverzeichnis identifizieren
      Returns:
      Verzeichnis
    • getPath

      public Path getPath(IdDataIdentification dataIdentification)
      Gibt zu einer Datenidentifikation das Dateisystemverzeichnis zurück
      Parameters:
      dataIdentification - Datenidentifikation
      Returns:
      Verzeichnis
    • getPathType

      public PathType getPathType(ArrayList<String> pathStack)
      Identifiziert den Typ des angegebenen Verzeichnisses
      Parameters:
      pathStack - Stack wo man sich im Verzeichnisbaum befindet, siehe toStack(Path)
      Returns:
      Typ des angegebenen Pfads
    • getPath

      public IdDataIdentification getPath(ArrayList<String> pathStack)
      Identifiziert die Datenidentifiaktion des angegebenen Verzeichnisses
      Parameters:
      pathStack - Stack wo man sich im Verzeichnisbaum befindet, siehe toStack(Path)
      Returns:
      Typ des angegebenen Pfads
    • detectFromPath

      @NotNull public static PersistenceDirectoryLayoutInstance detectFromPath(Path path) throws PersistenceException
      Versucht, von einem Verzeichnis zu ermitteln, welches persistenzverzeichnislayout in diesem Verzeichnis genutzt wird und gibt dies als PersistenceDirectoryLayoutInstance zurück.
      Parameters:
      path - Verzeichnis
      Returns:
      Instanz (nie null)
      Throws:
      PersistenceException - wenn die Instanz nicht ermittelt werden konnte
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • layout

      public PersistenceDirectoryLayout layout()
      Returns the value of the layout record component.
      Returns:
      the value of the layout record component
    • basePath

      public Path basePath()
      Returns the value of the basePath record component.
      Returns:
      the value of the basePath record component
    • simulationVariant

      public int simulationVariant()
      Returns the value of the simulationVariant record component.
      Returns:
      the value of the simulationVariant record component