org.ka2ddo.yaac.gui.pluginstore
Class PluginDescriptor

java.lang.Object
  extended by org.ka2ddo.yaac.gui.pluginstore.PluginDescriptor
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<PluginDescriptor>

public class PluginDescriptor
extends java.lang.Object
implements java.lang.Comparable<PluginDescriptor>, java.io.Serializable

This class describes the parameters for one plugin, including its filename, its display name, the version of it currently installed (if any), and the version available in the "store" (if any) or the mark indicating the plugin is obsoleted.

See Also:
Serialized Form

Field Summary
 java.lang.String displayName
          The human-readable name of the plugin, as reported by the getName() method.
 java.lang.String installedVersion
          The human-readable version identifier for the installed version of the plugin, or null if this plugin is not yet installed into the local copy of YAAC.
 java.lang.String pkgName
          The internal distro file name of the plugin.
 java.lang.String storeType
          The means by which the plugin is distributed from the website, or null if this plugin is not currently available from the website.
 java.lang.String storeVersion
          The human-readable version identifier for the version of the plugin currently available on the author's website, or null if this plugin is not available from the website.
 
Constructor Summary
PluginDescriptor(Provider p)
          Create a PluginDescriptor from an installed plugin instance.
PluginDescriptor(java.lang.String storeLine)
          Create a PluginDescriptor from a comma-separated-values (CSV) record obtained from the author's website.
 
Method Summary
 int compareTo(PluginDescriptor o)
          Compares this object with the specified PluginDescriptor for order.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 int hashCode()
          Returns a hash code value for the object.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

pkgName

public java.lang.String pkgName
The internal distro file name of the plugin.


displayName

public java.lang.String displayName
The human-readable name of the plugin, as reported by the getName() method.


installedVersion

public java.lang.String installedVersion
The human-readable version identifier for the installed version of the plugin, or null if this plugin is not yet installed into the local copy of YAAC.


storeVersion

public java.lang.String storeVersion
The human-readable version identifier for the version of the plugin currently available on the author's website, or null if this plugin is not available from the website.


storeType

public java.lang.String storeType
The means by which the plugin is distributed from the website, or null if this plugin is not currently available from the website. Currently, two formats are supported:

Constructor Detail

PluginDescriptor

public PluginDescriptor(Provider p)
Create a PluginDescriptor from an installed plugin instance.

Parameters:
p - Provider object defining the plugin's attributes

PluginDescriptor

public PluginDescriptor(java.lang.String storeLine)
Create a PluginDescriptor from a comma-separated-values (CSV) record obtained from the author's website. The CSV record is in the following format: package_name,version,distro format,description of what the plugin provides

Parameters:
storeLine - CSV record to decode
Method Detail

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
hashCode(), HashMap

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.
See Also:
equals(Object)

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.

compareTo

public int compareTo(PluginDescriptor o)
Compares this object with the specified PluginDescriptor for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface java.lang.Comparable<PluginDescriptor>
Parameters:
o - the object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.NullPointerException - if the specified object is null
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this object.