ModuleRevisionId
Date: 2014-12-13

org.apache.ivy.core.module.id

## Class ModuleRevisionId

- java.lang.Object
- - org.apache.ivy.util.extendable.UnmodifiableExtendableItem
  - - org.apache.ivy.core.module.id.ModuleRevisionId

- All Implemented Interfaces:
    ExtendableItem

      public class ModuleRevisionId
      extends UnmodifiableExtendableItem

  Identifies a module in a particular version
  See Also:
    org.apache.ivy.core.module.id

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.util.regex.Pattern` | `MRID_PATTERN` Pattern to use to matched mrid text representation.
    `static java.util.regex.Pattern` | `NON_CAPTURING_PATTERN` Same as MRID_PATTERN but using non capturing groups, useful to build larger regexp

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ModuleRevisionId(ModuleId moduleId, java.lang.String revision)`
    `ModuleRevisionId(ModuleId moduleId, java.lang.String branch, java.lang.String revision)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ModuleRevisionId` | `decode(java.lang.String encoded)`
    `java.lang.String` | `encodeToString()`
    `boolean` | `equals(java.lang.Object obj)`
    `java.lang.String` | `getBranch()`
    `ModuleId` | `getModuleId()`
    `java.lang.String` | `getName()`
    `java.lang.String` | `getOrganisation()`
    `java.lang.String` | `getRevision()`
    `int` | `hashCode()`
    `static ModuleRevisionId` | `intern(ModuleRevisionId moduleRevisionId)` Returns an intern instance of the given ModuleRevisionId if any, or put the given ModuleRevisionId in a cache of intern instances and returns it.
    `static ModuleRevisionId` | `newInstance(ModuleRevisionId mrid, java.lang.String rev)`
    `static ModuleRevisionId` | `newInstance(ModuleRevisionId mrid, java.lang.String branch, java.lang.String rev)`
    `static ModuleRevisionId` | `newInstance(java.lang.String organisation, java.lang.String name, java.lang.String revision)`
    `static ModuleRevisionId` | `newInstance(java.lang.String organisation, java.lang.String name, java.lang.String revision, java.util.Map extraAttributes)`
    `static ModuleRevisionId` | `newInstance(java.lang.String organisation, java.lang.String name, java.lang.String branch, java.lang.String revision)`
    `static ModuleRevisionId` | `newInstance(java.lang.String organisation, java.lang.String name, java.lang.String branch, java.lang.String revision, java.util.Map extraAttributes)`
    `static ModuleRevisionId` | `newInstance(java.lang.String organisation, java.lang.String name, java.lang.String branch, java.lang.String revision, java.util.Map extraAttributes, boolean replaceNullBranchWithDefault)`
    `static ModuleRevisionId` | `parse(java.lang.String mrid)` Parses a module revision id text representation and returns a new `ModuleRevisionId` instance corresponding to the parsed String.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class org.apache.ivy.util.extendable.UnmodifiableExtendableItem

      `getAttribute, getAttributes, getExtraAttribute, getExtraAttributes, getQualifiedExtraAttributes, setExtraAttribute, setStandardAttribute`

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

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

- - ### Field Detail

    - #### MRID_PATTERN

          public static final java.util.regex.Pattern MRID_PATTERN

      Pattern to use to matched mrid text representation.
      See Also:
        `parse(String)`

    - #### NON_CAPTURING_PATTERN

          public static final java.util.regex.Pattern NON_CAPTURING_PATTERN

      Same as MRID_PATTERN but using non capturing groups, useful to build larger regexp

  - ### Constructor Detail

    - #### ModuleRevisionId

          public ModuleRevisionId(ModuleId moduleId,
                          java.lang.String revision)

    - #### ModuleRevisionId

          public ModuleRevisionId(ModuleId moduleId,
                          java.lang.String branch,
                          java.lang.String revision)

  - ### Method Detail

    - #### parse

          public static ModuleRevisionId parse(java.lang.String mrid)

      Parses a module revision id text representation and returns a new `ModuleRevisionId` instance corresponding to the parsed String.

      The result is unspecified if the module doesn't respect strict name conventions.

      Parameters:
        `mrid` - the text representation of the module (as returned by `toString()`). Must not be `null`.
      Returns:
        a `ModuleRevisionId` corresponding to the given text representation
      Throws:
        `java.lang.IllegalArgumentException` - if the given text representation does not match the `ModuleRevisionId` text representation rules.

    - #### newInstance

          public static ModuleRevisionId newInstance(java.lang.String organisation,
                                     java.lang.String name,
                                     java.lang.String revision)

    - #### newInstance

          public static ModuleRevisionId newInstance(java.lang.String organisation,
                                     java.lang.String name,
                                     java.lang.String revision,
                                     java.util.Map extraAttributes)

    - #### newInstance

          public static ModuleRevisionId newInstance(java.lang.String organisation,
                                     java.lang.String name,
                                     java.lang.String branch,
                                     java.lang.String revision)

    - #### newInstance

          public static ModuleRevisionId newInstance(java.lang.String organisation,
                                     java.lang.String name,
                                     java.lang.String branch,
                                     java.lang.String revision,
                                     java.util.Map extraAttributes)

    - #### newInstance

          public static ModuleRevisionId newInstance(java.lang.String organisation,
                                     java.lang.String name,
                                     java.lang.String branch,
                                     java.lang.String revision,
                                     java.util.Map extraAttributes,
                                     boolean replaceNullBranchWithDefault)

    - #### newInstance

          public static ModuleRevisionId newInstance(ModuleRevisionId mrid,
                                     java.lang.String rev)

    - #### newInstance

          public static ModuleRevisionId newInstance(ModuleRevisionId mrid,
                                     java.lang.String branch,
                                     java.lang.String rev)

    - #### intern

          public static ModuleRevisionId intern(ModuleRevisionId moduleRevisionId)

      Returns an intern instance of the given ModuleRevisionId if any, or put the given ModuleRevisionId in a cache of intern instances and returns it.

      This method should be called on ModuleRevisionId created with one of the constructor to decrease memory footprint.

      When using static newInstances methods, this method is already called.

      Parameters:
        `moduleRevisionId` - the module revision id to intern
      Returns:
        an interned ModuleRevisionId

    - #### getModuleId

          public ModuleId getModuleId()

    - #### getName

          public java.lang.String getName()

    - #### getOrganisation

          public java.lang.String getOrganisation()

    - #### getRevision

          public java.lang.String getRevision()

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### encodeToString

          public java.lang.String encodeToString()

    - #### decode

          public static ModuleRevisionId decode(java.lang.String encoded)

    - #### getBranch

          public java.lang.String getBranch()