Package org.eclipse.pde.core.target

## 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
`static String` `TYPE_FEATURE`
`static String` `TYPE_PACKAGE`
`static String` `TYPE_PLUGIN`

### Constructor Summary

Constructors
`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

All Methods Static Methods Instance Methods Concrete Methods
`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 java.lang.Object

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

### Field Detail

#### 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 Detail

#### 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 Detail

#### 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