org.sonatype.aether.util.metadata
Class DefaultMetadata

java.lang.Object
  extended by org.sonatype.aether.util.metadata.DefaultMetadata
All Implemented Interfaces:
Metadata

public final class DefaultMetadata
extends Object
implements Metadata

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

Author:
Benjamin Bentmann

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.sonatype.aether.metadata.Metadata
Metadata.Nature
 
Constructor Summary
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.
 
Method Summary
 String getArtifactId()
           
 File getFile()
           
 String getGroupId()
           
 Metadata.Nature getNature()
           
 String getType()
           
 String getVersion()
           
 Metadata setFile(File file)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, 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.
Method Detail

getGroupId

public String getGroupId()
Specified by:
getGroupId in interface Metadata

getArtifactId

public String getArtifactId()
Specified by:
getArtifactId in interface Metadata

getVersion

public String getVersion()
Specified by:
getVersion in interface Metadata

getType

public String getType()
Specified by:
getType in interface Metadata

getNature

public Metadata.Nature getNature()
Specified by:
getNature in interface Metadata

getFile

public File getFile()
Specified by:
getFile in interface Metadata

setFile

public Metadata setFile(File file)
Specified by:
setFile in interface Metadata

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.