# Class NameVersionDescriptor

java.lang.Object
org.eclipse.pde.core.target.NameVersionDescriptor

public class NameVersionDescriptor extends Object
Describes something with a name and version.

Since:
  3.8
Restriction:
  This class is not intended to be subclassed by clients.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`TYPE_FEATURE`
`static final String`
`TYPE_PACKAGE`
`static final String`
`TYPE_PLUGIN`

## Constructor Summary

Constructors
Constructor
Description
`NameVersionDescriptor(String id, String version)`
Constructs a descriptor with a type of 'plugin'
`NameVersionDescriptor(String id, String version, String type)`
Constructs a descriptor of the given type

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
`static NameVersionDescriptor`
`fromPortableString(String portable)`
Creates a descriptor from a portable string.
`String`
`getId()`
`String`
`getType()`
`String`
`getVersion()`
`int`
`hashCode()`
`String`
`toPortableString()`
Returns a portable form for this descriptor.
`String`
`toString()`

### Methods inherited from class Object

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

## Field Details

### TYPE_PLUGIN

public static final String TYPE_PLUGIN

See Also:
  - Constant Field Values

### TYPE_FEATURE

public static final String TYPE_FEATURE

See Also:
  - Constant Field Values

### TYPE_PACKAGE

public static final String TYPE_PACKAGE

See Also:
  - Constant Field Values

## Constructor Details

### NameVersionDescriptor

public NameVersionDescriptor(String id, String version)
Constructs a descriptor with a type of 'plugin'

If the passed string version is equal to `BundleInfo.EMPTY_VERSION`, the version will be replaced with `null`.

Parameters:
  `id` - name identifier
  `version` - version identifier, can be `null`

### NameVersionDescriptor

public NameVersionDescriptor(String id, String version, String type)
Constructs a descriptor of the given type

If the passed string version is equal to `BundleInfo.EMPTY_VERSION`, the version will be replaced with `null`.

Parameters:
  `id` - name identifier
  `version` - version identifier, can be `null`
  `type` - type of object this descriptor represents, should be one of the TYPE constants defined in this file

## Method Details

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### getId

public String getId()

### getVersion

public String getVersion()

### getType

public String getType()

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### fromPortableString

public static NameVersionDescriptor fromPortableString(String portable)
Creates a descriptor from a portable string.

Parameters:
  `portable` - generated from `toPortableString()`
Returns:
  descriptor

### toPortableString

public String toPortableString()
Returns a portable form for this descriptor.

Returns:
  portable form