public final class ServiceName extends Object implements Comparable<ServiceName>, Serializable
Modifier and Type | Field and Description |
---|---|
static ServiceName |
JBOSS
The root name "jboss".
|
Modifier and Type | Method and Description |
---|---|
ServiceName |
append(ServiceName serviceName)
Create a service name by appending name parts of the provided ServiceName using this as a parent.
|
ServiceName |
append(String... parts)
Create a service name by appending name parts using this as a parent to the new ServiceName.
|
ServiceName |
commonAncestorOf(ServiceName other)
Return the service name that is the nearest common ancestor of the this name and the given one.
|
int |
compareTo(ServiceName o)
Compare two service names lexicographically.
|
boolean |
equals(Object o)
Compare this service name to another service name.
|
boolean |
equals(ServiceName o)
Compare this service name to another service name.
|
String |
getCanonicalName()
Get the canonical name of this service name.
|
ServiceName |
getParent()
Get the parent (enclosing) service name.
|
String |
getSimpleName()
Get the simple (unqualified) name of this service.
|
int |
hashCode()
Return the hash code of this service name.
|
boolean |
isParentOf(ServiceName other)
Determine whether this service name is the same as, or a parent of, the given service name.
|
static boolean |
isValidNameSegment(String part)
Indicates if the name segment is valid.
|
int |
length()
Get the length (in segments) of this service name.
|
static ServiceName |
of(ServiceName parent,
String... parts)
Create a ServiceName from a series of String parts and a parent service name.
|
static ServiceName |
of(String... parts)
Create a ServiceName from a series of String parts.
|
static ServiceName |
parse(String original)
Parse a string-form service name.
|
String[] |
toArray()
Convert this service name into an array of strings containing the segments of the name.
|
String |
toString()
Get a string representation of this service name.
|
public static final ServiceName JBOSS
public static ServiceName of(String... parts)
parts
- The string representations of the service name segmentspublic static ServiceName of(ServiceName parent, String... parts)
parent
- The parent ServiceName for this nameparts
- The string representations of the service name segmentspublic ServiceName append(String... parts)
parts
- The parts to appendpublic ServiceName append(ServiceName serviceName)
serviceName
- The service name to use as the parts to appendpublic int length()
public ServiceName getParent()
public String getSimpleName()
public boolean isParentOf(ServiceName other)
other
- the other nametrue
if this service name is a parentpublic ServiceName commonAncestorOf(ServiceName other)
other
- the other namenull
if they are unrelatedpublic boolean equals(Object o)
public boolean equals(ServiceName o)
o
- the other service nametrue
if they are equal, false
if they are not equal or the argument is null
public int hashCode()
public String toString()
public String getCanonicalName()
public static boolean isValidNameSegment(String part)
part
- a name segmenttrue
if part
is validpublic static ServiceName parse(String original) throws IllegalArgumentException
"
' characters), then
the section will be parsed as a quoted string with optional escaped characters. The set of valid escapes is
similar to what is supported by the JLS (§3.3 and §3.10.6), with one exception: the string \0
is always parsed as a NUL character
(0) and not as an octal escape sequence. Control characters are not allowed in any part of a name
and must be escaped in a quoted section if they are present in the service name string. Whitespace characters
are allowed only in a quoted section.original
- the string form of a service nameServiceName
instanceIllegalArgumentException
- if the original is not validpublic int compareTo(ServiceName o)
compareTo
in interface Comparable<ServiceName>
o
- the other namepublic String[] toArray()
of(String...)
it will yield a ServiceName
which is equal to this one.Copyright © 2017 JBoss by Red Hat. All rights reserved.