public abstract class ServiceId
extends java.lang.Object
The extensions of this class must be immutable and hence thread-safe.
| Constructor and Description |
|---|
ServiceId() |
| Modifier and Type | Method and Description |
|---|---|
abstract java.lang.String |
getArtifactId()
Returns the artifact id of this service (e.g., "land-registry"), aka service name.
|
abstract java.lang.String |
getGroupId()
Returns the group id of this service (e.g., "com.acme").
|
abstract java.lang.String |
getVersion()
Returns the version of this service (e.g., "1.2.0").
|
static ServiceId |
of(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version)
Creates a new service id of the given coordinate.
|
static ServiceId |
parseFrom(java.lang.String serviceId)
Parses a service id in format "groupId:artifactId:version" as
toString() produces. |
java.lang.String |
toString()
Returns a service id in the following format: "groupId:artifactId:version".
|
public abstract java.lang.String getGroupId()
public abstract java.lang.String getArtifactId()
public abstract java.lang.String getVersion()
public static ServiceId parseFrom(java.lang.String serviceId)
toString() produces.serviceId - a string in format "groupId:artifactId:version". Whitespace characters,
including preceding and trailing, are not allowedjava.lang.IllegalArgumentException - if the format is not correctpublic static ServiceId of(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
java.lang.IllegalArgumentException - if any coordinate contains forbidden characters: whitespace,
colonpublic final java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2019 Exonum. All rights reserved.