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 java.lang.Object
implements Metadata

A basic metadata instance.

Author:
Benjamin Bentmann

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.sonatype.aether.metadata.Metadata
Metadata.Nature
 
Constructor Summary
DefaultMetadata(java.lang.String type, Metadata.Nature nature)
           
DefaultMetadata(java.lang.String groupId, java.lang.String type, Metadata.Nature nature)
           
DefaultMetadata(java.lang.String groupId, java.lang.String artifactId, java.lang.String type, Metadata.Nature nature)
           
DefaultMetadata(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String type, Metadata.Nature nature)
           
DefaultMetadata(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String type, Metadata.Nature nature, java.io.File file)
           
 
Method Summary
 java.lang.String getArtifactId()
          Gets the artifact identifier of this metadata.
 java.io.File getFile()
          Gets the file of this metadata.
 java.lang.String getGroupId()
          Gets the group identifier of this metadata.
 Metadata.Nature getNature()
          Gets the nature of this metadata.
 java.lang.String getType()
          Gets the type of the metadata, e.g.
 java.lang.String getVersion()
          Gets the version of this metadata.
 Metadata setFile(java.io.File file)
          Sets the file of the metadata.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultMetadata

public DefaultMetadata(java.lang.String type,
                       Metadata.Nature nature)

DefaultMetadata

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

DefaultMetadata

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

DefaultMetadata

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

DefaultMetadata

public DefaultMetadata(java.lang.String groupId,
                       java.lang.String artifactId,
                       java.lang.String version,
                       java.lang.String type,
                       Metadata.Nature nature,
                       java.io.File file)
Method Detail

getGroupId

public java.lang.String getGroupId()
Description copied from interface: Metadata
Gets the group identifier of this metadata.

Specified by:
getGroupId in interface Metadata
Returns:
The group identifier or an empty string if the metadata applies to the entire repository, never null.

getArtifactId

public java.lang.String getArtifactId()
Description copied from interface: Metadata
Gets the artifact identifier of this metadata.

Specified by:
getArtifactId in interface Metadata
Returns:
The artifact identifier or an empty string if the metadata applies to the groupId level only, never null.

getVersion

public java.lang.String getVersion()
Description copied from interface: Metadata
Gets the version of this metadata.

Specified by:
getVersion in interface Metadata
Returns:
The version or an empty string if the metadata applies to the groupId:artifactId level only, never null.

getType

public java.lang.String getType()
Description copied from interface: Metadata
Gets the type of the metadata, e.g. "maven-metadata.xml".

Specified by:
getType in interface Metadata
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.

Specified by:
getNature in interface Metadata
Returns:
The nature, never null.

getFile

public java.io.File getFile()
Description copied from interface: Metadata
Gets the file of this metadata. Note that only resolved metadata has a file associated with it.

Specified by:
getFile in interface Metadata
Returns:
The file or null if none.

setFile

public Metadata setFile(java.io.File file)
Description copied from interface: Metadata
Sets the file of the metadata.

Specified by:
setFile in interface Metadata
Parameters:
file - The file of the metadata, may be null
Returns:
The new metadata, never null.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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