Package org.eclipse.aether.metadata
Interface Metadata
-
- All Known Subinterfaces:
MergeableMetadata
- All Known Implementing Classes:
AbstractMetadata,DefaultMetadata
public interface MetadataA piece of repository metadata, e.g. an index of available versions. In contrast to an artifact, which usually exists in only one repository, metadata usually exists in multiple repositories and each repository contains a different copy of the metadata. Note: Metadata instances are supposed to be immutable, e.g. any exposed mutator method returns a new metadata instance and leaves the original instance unchanged. Implementors are strongly advised to obey this contract. Note: Implementors are strongly advised to inherit fromAbstractMetadatainstead of directly implementing this interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMetadata.NatureThe nature of the metadata.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.StringgetProperty(java.lang.String key, java.lang.String defaultValue)Gets the specified property.java.lang.StringgetType()Gets the type of the metadata, e.g.java.lang.StringgetVersion()Gets the version of this metadata.MetadatasetFile(java.io.File file)Sets the file of the metadata.MetadatasetProperties(java.util.Map<java.lang.String,java.lang.String> properties)Sets the properties for the metadata.
-
-
-
Method Detail
-
getGroupId
java.lang.String getGroupId()
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
java.lang.String getArtifactId()
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
java.lang.String getVersion()
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
java.lang.String getType()
Gets the type of the metadata, e.g. "maven-metadata.xml".- Returns:
- The type of the metadata, never
null.
-
getNature
Metadata.Nature getNature()
Gets the nature of this metadata. The nature indicates to what artifact versions the metadata refers.- Returns:
- The nature, never
null.
-
getFile
java.io.File getFile()
Gets the file of this metadata. Note that only resolved metadata has a file associated with it.- Returns:
- The file or
nullif none.
-
setFile
Metadata setFile(java.io.File file)
Sets the file of the metadata.- Parameters:
file- The file of the metadata, may benull- Returns:
- The new metadata, never
null.
-
getProperty
java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)Gets the specified property.- Parameters:
key- The name of the property, must not benull.defaultValue- The default value to return in case the property is not set, may benull.- Returns:
- The requested property value or
nullif the property is not set and no default value was provided.
-
getProperties
java.util.Map<java.lang.String,java.lang.String> getProperties()
Gets the properties of this metadata.- Returns:
- The (read-only) properties, never
null.
-
setProperties
Metadata setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Sets the properties for the metadata.- Parameters:
properties- The properties for the metadata, may benull.- Returns:
- The new metadata, never
null.
-
-