Record Class Folder

java.lang.Object
java.lang.Record
com.github.sormuras.bach.project.Folder
Record Components:
directory - the directory
version - the Java feature release version to target
types - the set of types associated with the directory
All Implemented Interfaces:
Comparable<Folder>

public record Folder(Path directory, int version, FolderTypes types) extends Record implements Comparable<Folder>
Targets a folder to a Java feature version, with 0 indicating no target version.
  • Constructor Details

    • Folder

      public Folder(Path directory, int version, FolderTypes types)
      Creates an instance of a Folder record class.
      Parameters:
      directory - the value for the directory record component
      version - the value for the version record component
      types - the value for the types record component
  • Method Details

    • with

      public Folder with(Object component)
    • compareTo

      public int compareTo(Folder other)
      Specified by:
      compareTo in interface Comparable<Folder>
    • 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.
    • directory

      public Path directory()
      Returns the value of the directory record component.
      Returns:
      the value of the directory record component
    • version

      public int version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • types

      public FolderTypes types()
      Returns the value of the types record component.
      Returns:
      the value of the types record component