java.lang.Object
org.apache.maven.artifact.repository.metadata.v4.Metadata
All Implemented Interfaces:
Serializable

@Experimental @Generated @ThreadSafe @Immutable public class Metadata extends Object implements Serializable
See Also:
  • Method Details

    • getNamespaceUri

      public String getNamespaceUri()
    • getModelEncoding

      public String getModelEncoding()
    • getModelVersion

      public String getModelVersion()
      The version of the underlying metadata model.
      Returns:
      a String
    • getGroupId

      public String getGroupId()
      The groupId when this directory represents "groupId/artifactId" or "groupId/artifactId/version".
      Returns:
      a String
    • getArtifactId

      public String getArtifactId()
      The artifactId when this directory represents "groupId/artifactId" or "groupId/artifactId/version".
      Returns:
      a String
    • getVersioning

      public Versioning getVersioning()
      Versioning information when this directory represents "groupId/artifactId" or "groupId/artifactId/version".
      Returns:
      a Versioning
    • getVersion

      public String getVersion()
      The base version (ie. ending in -SNAPSHOT) when this directory represents a "groupId/artifactId/version" for a SNAPSHOT.
      Returns:
      a String
    • getPlugins

      @Nonnull public List<Plugin> getPlugins()
      The set of plugins when this directory represents a "groupId".
      Returns:
      a List<Plugin>
    • with

      @Nonnull public Metadata.Builder with()
      Creates a new builder with this object as the basis.
      Returns:
      a Builder
    • withModelVersion

      @Nonnull public Metadata withModelVersion(String modelVersion)
      Creates a new Metadata instance using the specified modelVersion.
      Parameters:
      modelVersion - the new String to use
      Returns:
      a Metadata with the specified modelVersion
    • withGroupId

      @Nonnull public Metadata withGroupId(String groupId)
      Creates a new Metadata instance using the specified groupId.
      Parameters:
      groupId - the new String to use
      Returns:
      a Metadata with the specified groupId
    • withArtifactId

      @Nonnull public Metadata withArtifactId(String artifactId)
      Creates a new Metadata instance using the specified artifactId.
      Parameters:
      artifactId - the new String to use
      Returns:
      a Metadata with the specified artifactId
    • withVersioning

      @Nonnull public Metadata withVersioning(Versioning versioning)
      Creates a new Metadata instance using the specified versioning.
      Parameters:
      versioning - the new Versioning to use
      Returns:
      a Metadata with the specified versioning
    • withVersion

      @Nonnull public Metadata withVersion(String version)
      Creates a new Metadata instance using the specified version.
      Parameters:
      version - the new String to use
      Returns:
      a Metadata with the specified version
    • withPlugins

      @Nonnull public Metadata withPlugins(Collection<Plugin> plugins)
      Creates a new Metadata instance using the specified plugins.
      Parameters:
      plugins - the new Collection<Plugin> to use
      Returns:
      a Metadata with the specified plugins
    • newInstance

      @Nonnull public static Metadata newInstance()
      Creates a new Metadata instance. Equivalent to newInstance(true).
      Returns:
      a new Metadata
      See Also:
    • newInstance

      @Nonnull public static Metadata newInstance(boolean withDefaults)
      Creates a new Metadata instance using default values or not. Equivalent to newBuilder(withDefaults).build().
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Metadata
    • newBuilder

      @Nonnull public static Metadata.Builder newBuilder()
      Creates a new Metadata builder instance. Equivalent to newBuilder(true).
      Returns:
      a new Builder
      See Also:
    • newBuilder

      @Nonnull public static Metadata.Builder newBuilder(boolean withDefaults)
      Creates a new Metadata builder instance using default values or not.
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Metadata.Builder newBuilder(Metadata from)
      Creates a new Metadata builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the Metadata instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Metadata.Builder newBuilder(Metadata from, boolean forceCopy)
      Creates a new Metadata builder instance using the specified object as a basis.
      Parameters:
      from - the Metadata instance to use as a basis
      forceCopy - the boolean indicating if a copy should be forced
      Returns:
      a new Builder