Package i5.las2peer.api.p2p
Class ServiceNameVersion
java.lang.Object
i5.las2peer.api.p2p.ServiceNameVersion
- All Implemented Interfaces:
Serializable
identifies a service name and version
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionServiceNameVersion
(String name, ServiceVersion version) Instantiate a ServiceNameVersionServiceNameVersion
(String name, String version) Instantiate a ServiceNameVersion -
Method Summary
Modifier and TypeMethodDescriptionboolean
true if name and version are the sameboolean
fits
(ServiceNameVersion required) Checks if the this version fits the required versionstatic ServiceNameVersion
fromString
(String nameVersion) construct a ServiceNameVersion from a String of the format name@versiongetName()
Gets the service nameGets a string representationGets the package name of the serviceGets the simple name of the service classGets the service versionint
hashCode()
toString()
static String
toString
(String serviceName, ServiceVersion version) static String
-
Field Details
-
SEPERATOR
- See Also:
-
-
Constructor Details
-
ServiceNameVersion
Instantiate a ServiceNameVersion- Parameters:
name
- A canonical service nameversion
- seeServiceVersion
how to specify a version
-
ServiceNameVersion
Instantiate a ServiceNameVersion- Parameters:
name
- A canonical service nameversion
- seeServiceVersion
how to specify a version
-
-
Method Details
-
getName
Gets the service name- Returns:
- Returns the service name
-
getPackageName
Gets the package name of the service- Returns:
- Returns the package name
-
getSimpleClassName
Gets the simple name of the service class- Returns:
- Returns the simple class name
-
getVersion
Gets the service version- Returns:
- Returns the service version
-
getNameVersion
Gets a string representation- Returns:
- Returns the name version string
-
equals
true if name and version are the same -
hashCode
public int hashCode() -
toString
-
toString
-
toString
-
fromString
construct a ServiceNameVersion from a String of the format name@version- Parameters:
nameVersion
- A string representing a canonical service name and version- Returns:
- Returns the service name version
-
fits
Checks if the this version fits the required version- Parameters:
required
- A required service name and version to check for- Returns:
- Returns true if the names are equal and this version fits the required version
-