org.eclipse.aether.metadata

## Class AbstractMetadata

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

- All Implemented Interfaces:
    Metadata
  Direct Known Subclasses:
    DefaultMetadata

      public abstract class AbstractMetadata
      extends Object
      implements Metadata

  A skeleton class for metadata.

- - ### Nested Class Summary

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

      `Metadata.Nature`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractMetadata()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static Map<String,String>` | `copyProperties(Map<String,String> properties)` Copies the specified metadata properties.
    `boolean` | `equals(Object obj)` Compares this metadata with the specified object.
    `String` | `getProperty(String key, String defaultValue)` Gets the specified property.
    `int` | `hashCode()` Returns a hash code for this metadata.
    `Metadata` | `setFile(File file)` Sets the file of the metadata.
    `Metadata` | `setProperties(Map<String,String> properties)` Sets the properties for the metadata.
    `String` | `toString()`

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

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

    - ### Methods inherited from interface org.eclipse.aether.metadata.Metadata

      `getArtifactId, getFile, getGroupId, getNature, getProperties, getType, getVersion`

- - ### Constructor Detail

    - #### AbstractMetadata

          public AbstractMetadata()

  - ### Method Detail

    - #### setFile

          public Metadata setFile(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`.

    - #### setProperties

          public Metadata setProperties(Map<String,String> properties)

      Description copied from interface: `Metadata`
      Sets the properties for the metadata.
      Specified by:
        `setProperties` in interface `Metadata`
      Parameters:
        `properties` - The properties for the metadata, may be `null`.
      Returns:
        The new metadata, never `null`.

    - #### getProperty

          public String getProperty(String key,
                           String defaultValue)

      Description copied from interface: `Metadata`
      Gets the specified property.
      Specified by:
        `getProperty` in interface `Metadata`
      Parameters:
        `key` - The name of the property, must not be `null`.
        `defaultValue` - The default value to return in case the property is not set, may be `null`.
      Returns:
        The requested property value or `null` if the property is not set and no default value was provided.

    - #### copyProperties

          protected static Map<String,String> copyProperties(Map<String,String> properties)

      Copies the specified metadata properties. This utility method should be used when creating new metadata instances with caller-supplied properties.
      Parameters:
        `properties` - The properties to copy, may be `null`.
      Returns:
        The copied and read-only properties, never `null`.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Compares this metadata with the specified object.
      Overrides:
        `equals` in class `Object`
      Parameters:
        `obj` - The object to compare this metadata against, may be `null`.
      Returns:
        `true` if and only if the specified object is another `Metadata` with equal coordinates, type, nature, properties and file, `false` otherwise.

    - #### hashCode

          public int hashCode()

      Returns a hash code for this metadata.
      Overrides:
        `hashCode` in class `Object`
      Returns:
        A hash code for the metadata.

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