Package org.eclipse.equinox.p2.repository.spi

## Class RepositoryReference

- java.lang.Object
- - org.eclipse.equinox.p2.repository.spi.RepositoryReference

All Implemented Interfaces:
  `IRepositoryReference`

    public class RepositoryReference
    extends Object
    implements IRepositoryReference

Concrete implementation of a repository reference. This class can be used by clients to define new repository references.

Since:
  2.0
See Also:
  `IMetadataRepository.addReferences(java.util.Collection)`
Restriction:
  This class is not intended to be subclassed by clients.

### Constructor Summary

Constructors
`RepositoryReference​(URI location, String nickname, int type, int options)` Creates a reference to another repository.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals​(Object obj)`
`URI` `getLocation()` Returns the location of the referenced repository
`String` `getNickname()` Returns the optional nickname of the referenced repository
`int` `getOptions()` Returns bit-wise or of option constants (currently either `IRepository.ENABLED` or `IRepository.NONE`).
`int` `getType()` Returns the type of the referenced repository (currently either `IRepository.TYPE_METADATA` or `IRepository.TYPE_ARTIFACT`)
`int` `hashCode()`

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

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

### Constructor Detail

#### RepositoryReference

    public RepositoryReference​(URI location,
                               String nickname,
                               int type,
                               int options)

Creates a reference to another repository. The `IRepository.ENABLED` option flag controls whether the referenced repository should be marked as enabled when added to the repository manager. If this flag is set, the repository will be marked as enabled when added to the repository manager. If this flag is missing, the repository will be marked as disabled.

Parameters:
  `location` - the location of the repository to add
  `nickname` - The nickname of the repository, or `null`
  `type` - the repository type (currently either `IRepository.TYPE_METADATA` or `IRepository.TYPE_ARTIFACT`).
  `options` - bit-wise or of option constants (currently either `IRepository.ENABLED` or `IRepository.NONE`).
See Also:
  `IRepositoryManager.setEnabled(URI, boolean)`

### Method Detail

#### equals

    public boolean equals​(Object obj)

Overrides:
  `equals` in class `Object`

#### getLocation

    public URI getLocation()

Returns the location of the referenced repository

Specified by:
  `getLocation` in interface `IRepositoryReference`
Returns:
  the location

#### getType

    public int getType()

Returns the type of the referenced repository (currently either `IRepository.TYPE_METADATA` or `IRepository.TYPE_ARTIFACT`)

Specified by:
  `getType` in interface `IRepositoryReference`
Returns:
  the repository type

#### getOptions

    public int getOptions()

Returns bit-wise or of option constants (currently either `IRepository.ENABLED` or `IRepository.NONE`).

Specified by:
  `getOptions` in interface `IRepositoryReference`
Returns:
  bit-wise or of option constants

#### getNickname

    public String getNickname()

Returns the optional nickname of the referenced repository

Specified by:
  `getNickname` in interface `IRepositoryReference`
Returns:
  The nickname or `null`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`