Record Class ProdosAttributePreservation

java.lang.Object
java.lang.Record
org.applecommander.transfer.ProdosAttributePreservation

public record ProdosAttributePreservation(String fileName, int fileType, int auxType, Path dataPath, Path resourcePath) extends Record
The ProdosAttributePreservation class is a partial implementation of the ProDOS Attribute Preservation documented on the NuLib site.
  • Field Details

    • PATTERN

      public static final Pattern PATTERN
  • Constructor Details

    • ProdosAttributePreservation

      public ProdosAttributePreservation(String fileName, int fileType, int auxType, Path dataPath, Path resourcePath)
      Creates an instance of a ProdosAttributePreservation record class.
      Parameters:
      fileName - the value for the fileName record component
      fileType - the value for the fileType record component
      auxType - the value for the auxType record component
      dataPath - the value for the dataPath record component
      resourcePath - the value for the resourcePath record component
  • Method Details

    • toProdosAttributes

      public ProdosAttributes toProdosAttributes() throws IOException
      Throws:
      IOException
    • test

      public static boolean test(Path path)
      Test if this file matches the expected filename pattern.
    • parse

      public static ProdosAttributePreservation parse(Path path)
      Given a filename that is in the correct format, create the ProdosAttributePreservation settings.
      Throws:
      IllegalArgumentException - if an unexpected filename format is given
    • builder

      public static ProdosAttributePreservation.Builder builder()
      Initiate the builder.
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • fileName

      public String fileName()
      Returns the value of the fileName record component.
      Returns:
      the value of the fileName record component
    • fileType

      public int fileType()
      Returns the value of the fileType record component.
      Returns:
      the value of the fileType record component
    • auxType

      public int auxType()
      Returns the value of the auxType record component.
      Returns:
      the value of the auxType record component
    • dataPath

      public Path dataPath()
      Returns the value of the dataPath record component.
      Returns:
      the value of the dataPath record component
    • resourcePath

      public Path resourcePath()
      Returns the value of the resourcePath record component.
      Returns:
      the value of the resourcePath record component