java.lang.Object
java.lang.Record
net.fabricmc.loom.configuration.providers.minecraft.library.Library

public record Library(String group, String name, String version, @Nullable String classifier, Library.Target target) extends Record
  • Constructor Details

    • Library

      public Library(String group, String name, String version, @Nullable String classifier, Library.Target target)
      Creates an instance of a Library record class.
      Parameters:
      group - the value for the group record component
      name - the value for the name record component
      version - the value for the version record component
      classifier - the value for the classifier record component
      target - the value for the target record component
  • Method Details

    • fromMaven

      public static Library fromMaven(String name, Library.Target target)
    • is

      public boolean is(String str)
      Returns true when the group or the group and name match.
      Parameters:
      str - Takes a string containing the maven group, or a group and name split by :
      Returns:
      true when the group or the group and name match.
    • mavenNotation

      public String mavenNotation()
    • withVersion

      public Library withVersion(String version)
    • withClassifier

      public Library withClassifier(@Nullable String classifier)
    • withTarget

      public Library withTarget(Library.Target target)
    • 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.
    • group

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

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

      public String version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • classifier

      public @Nullable String classifier()
      Returns the value of the classifier record component.
      Returns:
      the value of the classifier record component
    • target

      public Library.Target target()
      Returns the value of the target record component.
      Returns:
      the value of the target record component