com.codemonster.surinam.export.service
Class VersionedProviderImplementationName

java.lang.Object
  extended by com.codemonster.surinam.export.service.VersionedProviderImplementationName
All Implemented Interfaces:
Comparable

public class VersionedProviderImplementationName
extends Object
implements Comparable

This class is designed to be used as a compound hash map key for service implementations that are versioned in meta-data only. It is constructed, such that, another thread can independently create a key on its own and present it to the map for retrieval. To this end, we implement the equals, hashmap methods. Note that we also will allow equality in cases where the objects are different but their versioned name is equal.

The semantics of this key is that the fully-qualified class name, along with the version string will uniquely identify a service implementation.


Constructor Summary
VersionedProviderImplementationName(String name, String versionString)
           
 
Method Summary
 int compareTo(Object obj)
          Comparison simply consists of accounting for both the class name and the version.
 boolean equals(Object o)
           
 String getName()
           
 String getVersion()
           
 String getVersionedName()
          For internal comparisons, we want to be able to compare them in one shot, this will serve to make them sortable as well as map-retrievable.
 int hashCode()
          This hash accounts for the name and the version.
 void setName(String name)
           
 void setVersionString(String versionString)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionedProviderImplementationName

public VersionedProviderImplementationName(String name,
                                           String versionString)
Method Detail

setName

public void setName(String name)

setVersionString

public void setVersionString(String versionString)

getVersionedName

public String getVersionedName()
For internal comparisons, we want to be able to compare them in one shot, this will serve to make them sortable as well as map-retrievable.

Returns:
Returns the fully-qualified string that uniquely identifies this implementation.

getName

public String getName()

getVersion

public String getVersion()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
This hash accounts for the name and the version.

Overrides:
hashCode in class Object
Returns:
returns the hash value.

compareTo

public int compareTo(Object obj)
Comparison simply consists of accounting for both the class name and the version.

Specified by:
compareTo in interface Comparable
Parameters:
obj - The object to be compared against, which we expect to be an instance of VersionedProviderImplementationName.
Returns:
Usual comparator rules of less than, greater than, with zero being exact match.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010. All Rights Reserved.