org.eclipse.aether.metadata

## Class DefaultMetadata

- java.lang.Object
- - org.eclipse.aether.metadata.AbstractMetadata
  - - org.eclipse.aether.metadata.DefaultMetadata

- All Implemented Interfaces:
    Metadata

      public final class DefaultMetadata
      extends AbstractMetadata

  A basic metadata instance. Note: Instances of this class are immutable and the exposed mutators return new objects rather than changing the current instance.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.eclipse.aether.metadata.Metadata

      `Metadata.Nature`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultMetadata(String type, Metadata.Nature nature)` Creates a new metadata for the repository root with the specific type and nature.
    `DefaultMetadata(String groupId, String type, Metadata.Nature nature)` Creates a new metadata for the groupId level with the specific type and nature.
    `DefaultMetadata(String groupId, String artifactId, String type, Metadata.Nature nature)` Creates a new metadata for the groupId:artifactId level with the specific type and nature.
    `DefaultMetadata(String groupId, String artifactId, String version, String type, Metadata.Nature nature)` Creates a new metadata for the groupId:artifactId:version level with the specific type and nature.
    `DefaultMetadata(String groupId, String artifactId, String version, String type, Metadata.Nature nature, File file)` Creates a new metadata for the groupId:artifactId:version level with the specific type and nature.
    `DefaultMetadata(String groupId, String artifactId, String version, String type, Metadata.Nature nature, Map<String,String> properties, File file)` Creates a new metadata for the groupId:artifactId:version level with the specific type and nature.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getArtifactId()` Gets the artifact identifier of this metadata.
    `File` | `getFile()` Gets the file of this metadata.
    `String` | `getGroupId()` Gets the group identifier of this metadata.
    `Metadata.Nature` | `getNature()` Gets the nature of this metadata.
    `Map<String,String>` | `getProperties()` Gets the properties of this metadata.
    `String` | `getType()` Gets the type of the metadata, e.g.
    `String` | `getVersion()` Gets the version of this metadata.

    - ### Methods inherited from class org.eclipse.aether.metadata.AbstractMetadata

      `copyProperties, equals, getProperty, hashCode, setFile, setProperties, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultMetadata

          public DefaultMetadata(String type,
                         Metadata.Nature nature)

      Creates a new metadata for the repository root with the specific type and nature.
      Parameters:
        `type` - The type of the metadata, e.g. "maven-metadata.xml", may be `null`.
        `nature` - The nature of the metadata, must not be `null`.

    - #### DefaultMetadata

          public DefaultMetadata(String groupId,
                         String type,
                         Metadata.Nature nature)

      Creates a new metadata for the groupId level with the specific type and nature.
      Parameters:
        `groupId` - The group identifier to which this metadata applies, may be `null`.
        `type` - The type of the metadata, e.g. "maven-metadata.xml", may be `null`.
        `nature` - The nature of the metadata, must not be `null`.

    - #### DefaultMetadata

          public DefaultMetadata(String groupId,
                         String artifactId,
                         String type,
                         Metadata.Nature nature)

      Creates a new metadata for the groupId:artifactId level with the specific type and nature.
      Parameters:
        `groupId` - The group identifier to which this metadata applies, may be `null`.
        `artifactId` - The artifact identifier to which this metadata applies, may be `null`.
        `type` - The type of the metadata, e.g. "maven-metadata.xml", may be `null`.
        `nature` - The nature of the metadata, must not be `null`.

    - #### DefaultMetadata

          public DefaultMetadata(String groupId,
                         String artifactId,
                         String version,
                         String type,
                         Metadata.Nature nature)

      Creates a new metadata for the groupId:artifactId:version level with the specific type and nature.
      Parameters:
        `groupId` - The group identifier to which this metadata applies, may be `null`.
        `artifactId` - The artifact identifier to which this metadata applies, may be `null`.
        `version` - The version to which this metadata applies, may be `null`.
        `type` - The type of the metadata, e.g. "maven-metadata.xml", may be `null`.
        `nature` - The nature of the metadata, must not be `null`.

    - #### DefaultMetadata

          public DefaultMetadata(String groupId,
                         String artifactId,
                         String version,
                         String type,
                         Metadata.Nature nature,
                         File file)

      Creates a new metadata for the groupId:artifactId:version level with the specific type and nature.
      Parameters:
        `groupId` - The group identifier to which this metadata applies, may be `null`.
        `artifactId` - The artifact identifier to which this metadata applies, may be `null`.
        `version` - The version to which this metadata applies, may be `null`.
        `type` - The type of the metadata, e.g. "maven-metadata.xml", may be `null`.
        `nature` - The nature of the metadata, must not be `null`.
        `file` - The resolved file of the metadata, may be `null`.

    - #### DefaultMetadata

          public DefaultMetadata(String groupId,
                         String artifactId,
                         String version,
                         String type,
                         Metadata.Nature nature,
                         Map<String,String> properties,
                         File file)

      Creates a new metadata for the groupId:artifactId:version level with the specific type and nature.
      Parameters:
        `groupId` - The group identifier to which this metadata applies, may be `null`.
        `artifactId` - The artifact identifier to which this metadata applies, may be `null`.
        `version` - The version to which this metadata applies, may be `null`.
        `type` - The type of the metadata, e.g. "maven-metadata.xml", may be `null`.
        `nature` - The nature of the metadata, must not be `null`.
        `properties` - The properties of the metadata, may be `null` if none.
        `file` - The resolved file of the metadata, may be `null`.

  - ### Method Detail

    - #### getGroupId

          public String getGroupId()

      Description copied from interface: `Metadata`
      Gets the group identifier of this metadata.
      Returns:
        The group identifier or an empty string if the metadata applies to the entire repository, never `null`.

    - #### getArtifactId

          public String getArtifactId()

      Description copied from interface: `Metadata`
      Gets the artifact identifier of this metadata.
      Returns:
        The artifact identifier or an empty string if the metadata applies to the groupId level only, never `null`.

    - #### getVersion

          public String getVersion()

      Description copied from interface: `Metadata`
      Gets the version of this metadata.
      Returns:
        The version or an empty string if the metadata applies to the groupId:artifactId level only, never `null`.

    - #### getType

          public String getType()

      Description copied from interface: `Metadata`
      Gets the type of the metadata, e.g. "maven-metadata.xml".
      Returns:
        The type of the metadata, never `null`.

    - #### getNature

          public Metadata.Nature getNature()

      Description copied from interface: `Metadata`
      Gets the nature of this metadata. The nature indicates to what artifact versions the metadata refers.
      Returns:
        The nature, never `null`.

    - #### getFile

          public File getFile()

      Description copied from interface: `Metadata`
      Gets the file of this metadata. Note that only resolved metadata has a file associated with it.
      Returns:
        The file or `null` if none.

    - #### getProperties

          public Map<String,String> getProperties()

      Description copied from interface: `Metadata`
      Gets the properties of this metadata.
      Returns:
        The (read-only) properties, never `null`.

Copyright © 2010-2012 The Eclipse Foundation. All Rights Reserved.