Package 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
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringartifactIdprivate java.io.Filefileprivate java.lang.StringgroupIdprivate Metadata.Naturenatureprivate java.util.Map<java.lang.String,java.lang.String>propertiesprivate java.lang.Stringtypeprivate java.lang.Stringversion
-
Constructor Summary
Constructors Constructor Description DefaultMetadata(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String type, Metadata.Nature nature)Creates a new metadata for the groupId:artifactId:version level with the specific type and 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)Creates a new metadata for the groupId:artifactId:version level with the specific type and 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, java.util.Map<java.lang.String,java.lang.String> properties)DefaultMetadata(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String type, Metadata.Nature nature, java.util.Map<java.lang.String,java.lang.String> properties, java.io.File file)Creates a new metadata for the groupId:artifactId:version level with the specific type and nature.DefaultMetadata(java.lang.String groupId, java.lang.String artifactId, java.lang.String type, Metadata.Nature nature)Creates a new metadata for the groupId:artifactId level with the specific type and nature.DefaultMetadata(java.lang.String groupId, java.lang.String type, Metadata.Nature nature)Creates a new metadata for the groupId level with the specific type and nature.DefaultMetadata(java.lang.String type, Metadata.Nature nature)Creates a new metadata for the repository root with the specific type and nature.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.Stringemptify(java.lang.String str)java.lang.StringgetArtifactId()Gets the artifact identifier of this metadata.java.io.FilegetFile()Gets the file of this metadata.java.lang.StringgetGroupId()Gets the group identifier of this metadata.Metadata.NaturegetNature()Gets the nature of this metadata.java.util.Map<java.lang.String,java.lang.String>getProperties()Gets the properties of this metadata.java.lang.StringgetType()Gets the type of the metadata, e.g.java.lang.StringgetVersion()Gets the version of this metadata.-
Methods inherited from class org.eclipse.aether.metadata.AbstractMetadata
copyProperties, equals, getProperty, hashCode, setFile, setProperties, toString
-
-
-
-
Field Detail
-
groupId
private final java.lang.String groupId
-
artifactId
private final java.lang.String artifactId
-
version
private final java.lang.String version
-
type
private final java.lang.String type
-
nature
private final Metadata.Nature nature
-
file
private final java.io.File file
-
properties
private final java.util.Map<java.lang.String,java.lang.String> properties
-
-
Constructor Detail
-
DefaultMetadata
public DefaultMetadata(java.lang.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 benull.nature- The nature of the metadata, must not benull.
-
DefaultMetadata
public DefaultMetadata(java.lang.String groupId, java.lang.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 benull.type- The type of the metadata, e.g. "maven-metadata.xml", may benull.nature- The nature of the metadata, must not benull.
-
DefaultMetadata
public DefaultMetadata(java.lang.String groupId, java.lang.String artifactId, java.lang.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 benull.artifactId- The artifact identifier to which this metadata applies, may benull.type- The type of the metadata, e.g. "maven-metadata.xml", may benull.nature- The nature of the metadata, must not benull.
-
DefaultMetadata
public DefaultMetadata(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.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 benull.artifactId- The artifact identifier to which this metadata applies, may benull.version- The version to which this metadata applies, may benull.type- The type of the metadata, e.g. "maven-metadata.xml", may benull.nature- The nature of the metadata, must not benull.
-
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)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 benull.artifactId- The artifact identifier to which this metadata applies, may benull.version- The version to which this metadata applies, may benull.type- The type of the metadata, e.g. "maven-metadata.xml", may benull.nature- The nature of the metadata, must not benull.file- The resolved file of the metadata, may benull.
-
DefaultMetadata
public DefaultMetadata(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String type, Metadata.Nature nature, java.util.Map<java.lang.String,java.lang.String> properties, java.io.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 benull.artifactId- The artifact identifier to which this metadata applies, may benull.version- The version to which this metadata applies, may benull.type- The type of the metadata, e.g. "maven-metadata.xml", may benull.nature- The nature of the metadata, must not benull.properties- The properties of the metadata, may benullif none.file- The resolved file of the metadata, may benull.
-
DefaultMetadata
DefaultMetadata(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String type, Metadata.Nature nature, java.io.File file, java.util.Map<java.lang.String,java.lang.String> properties)
-
-
Method Detail
-
emptify
private static java.lang.String emptify(java.lang.String str)
-
getGroupId
public java.lang.String getGroupId()
Description copied from interface:MetadataGets 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 java.lang.String getArtifactId()
Description copied from interface:MetadataGets 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 java.lang.String getVersion()
Description copied from interface:MetadataGets 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 java.lang.String getType()
Description copied from interface:MetadataGets 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:MetadataGets the nature of this metadata. The nature indicates to what artifact versions the metadata refers.- Returns:
- The nature, never
null.
-
getFile
public java.io.File getFile()
Description copied from interface:MetadataGets the file of this metadata. Note that only resolved metadata has a file associated with it.- Returns:
- The file or
nullif none.
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
Description copied from interface:MetadataGets the properties of this metadata.- Returns:
- The (read-only) properties, never
null.
-
-