Record Class Artifact

java.lang.Object
java.lang.Record
fr.flowarg.nmsremaphelper.Artifact
Record Components:
group - the groupdId of the artifact (e.g: fr.flowarg)
name - the artifactId of the artifact (e.g: nmsremaphelper)
version - the version of the artifact (e.g: 1.0.0)
classifier - the classifier of the artifact (e.g: sources). Let this field empty if there is no classifier.

public record Artifact(String group, String name, String version, String classifier) extends Record
Represent an artifact (to be downloaded and used in the future)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    This field is used to build the url of the artifact to download from Maven Central repository.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Artifact(String group, String name, String version, String classifier)
    Creates an instance of a Artifact record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the classifier record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    String @NotNull []
    genURL(String repo, String ext)
    This method generates and return an url (and the corresponding file name) from the provided repository.
    Returns the value of the group record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the name record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the version record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CENTRAL

      public static final String CENTRAL
      This field is used to build the url of the artifact to download from Maven Central repository.
      See Also:
  • Constructor Details

    • Artifact

      public Artifact(String group, String name, String version, String classifier)
      Creates an instance of a Artifact 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
  • Method Details

    • genURL

      @Contract("_, _ -> new") public String @NotNull [] genURL(String repo, String ext)
      This method generates and return an url (and the corresponding file name) from the provided repository.
      Parameters:
      repo - repo to use (e.g: "CENTRAL")
      ext - the extension of the file (e.g: "jar" or "jar.sha1")
      Returns:
      the built url and filename of the artifact.
    • 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 String classifier()
      Returns the value of the classifier record component.
      Returns:
      the value of the classifier record component