Record Class ClassEntry

java.lang.Object
java.lang.Record
net.fabricmc.loom.decompilers.cache.ClassEntry
Record Components:
name - The class name
innerClasses - A list of inner class names
superClasses - A list of parent classes (super and interface) from the class and all inner classes

public record ClassEntry(String name, List<String> innerClasses, List<String> superClasses) extends Record
  • Constructor Details

    • ClassEntry

      public ClassEntry(String name, List<String> innerClasses, List<String> superClasses)
      Creates an instance of a ClassEntry record class.
      Parameters:
      name - the value for the name record component
      innerClasses - the value for the innerClasses record component
      superClasses - the value for the superClasses record component
  • Method Details

    • copyTo

      public void copyTo(Path sourceRoot, Path targetRoot) throws IOException
      Copy the class and its inner classes to the target root.
      Parameters:
      sourceRoot - The root of the source jar
      targetRoot - The root of the target jar
      Throws:
      IOException - If an error occurs while copying the files
    • hash

      public String hash(Path root) throws IOException
      Hash the class and its inner classes using sha256.
      Parameters:
      root - The root of the jar
      Returns:
      The hash of the class and its inner classes
      Throws:
      IOException - If an error occurs while hashing the files
    • hashSuperHierarchy

      public String hashSuperHierarchy(Map<String,String> hashes) throws IOException
      Return a hash of the class and its super classes.
      Throws:
      IOException
    • sourcesFileName

      public String sourcesFileName()
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • innerClasses

      public List<String> innerClasses()
      Returns the value of the innerClasses record component.
      Returns:
      the value of the innerClasses record component
    • superClasses

      public List<String> superClasses()
      Returns the value of the superClasses record component.
      Returns:
      the value of the superClasses record component