Class Artifact

java.lang.Object
org.moddingx.launcherlib.util.Artifact
All Implemented Interfaces:
Serializable, Comparable<Artifact>

public final class Artifact extends Object implements Comparable<Artifact>, Serializable
Represents a maven artifact.
See Also:
  • Method Details

    • from

      public static Artifact from(String descriptor)
      Creates a new artifact from the given descriptor.
    • from

      public static Artifact from(String group, String name, String version)
      Creates a new artifact from the given values.
    • from

      public static Artifact from(String group, String name, String version, @Nullable String classifier)
      Creates a new artifact from the given values.
    • from

      public static Artifact from(String group, String name, String version, @Nullable String classifier, @Nullable String extension)
      Creates a new artifact from the given values.
    • getGroup

      public String getGroup()
      Gets the artifacts group.
    • getName

      public String getName()
      Gets the artifacts name.
    • getVersion

      public String getVersion()
      Gets the artifacts version.
    • getClassifier

      @Nullable public String getClassifier()
      Gets the artifacts classifier or null if there is none.
    • getExtension

      @Nullable public String getExtension()
      Gets the artifacts extension or null if there is none.
    • getDescriptor

      public String getDescriptor()
      Gets the artifacts descriptor.
    • getPath

      public String getPath()
      Gets the path of the artifact inside a maven repository.
    • getPom

      public Artifact getPom()
      Gets an artifact describing the POM of this artifact.
    • withClassifier

      public Artifact withClassifier(@Nullable String classifier)
      Returns a copy of this artifact with the given classifier and no explicit extension.
    • withClassifier

      public Artifact withClassifier(@Nullable String classifier, @Nullable String extension)
      Returns a copy of this artifact with the given classifier and extension.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(@Nonnull Artifact artifact)
      Specified by:
      compareTo in interface Comparable<Artifact>
    • toString

      public String toString()
      Overrides:
      toString in class Object