JBoss Modular Service Kernel API 1.0.0.Beta1

org.jboss.msc.service
Class ServiceName

java.lang.Object
  extended by org.jboss.msc.service.ServiceName
All Implemented Interfaces:
Serializable, Comparable<ServiceName>

public final class ServiceName
extends Object
implements Comparable<ServiceName>, Serializable

Service name class.

Author:
John Bailey, David M. Lloyd
See Also:
Serialized Form

Field Summary
static ServiceName JBOSS
          The root name "jboss".
 
Method Summary
 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.
 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.
 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.
 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.
 String toString()
          Get a string representation of this service name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

JBOSS

public static final ServiceName JBOSS
The root name "jboss".

Method Detail

of

public static ServiceName of(String... parts)
Create a ServiceName from a series of String parts.

Parameters:
parts - The string representations of the service name segments
Returns:
A ServiceName instance

of

public static ServiceName of(ServiceName parent,
                             String... parts)
Create a ServiceName from a series of String parts and a parent service name.

Parameters:
parent - The parent ServiceName for this name
parts - The string representations of the service name segments
Returns:
A ServiceName instance

append

public ServiceName append(String... parts)
Create a service name by appending name parts using this as a parent to the new ServiceName.

Parameters:
parts - The parts to append
Returns:
A new ServiceName

append

public ServiceName append(ServiceName serviceName)
Create a service name by appending name parts of the provided ServiceName using this as a parent.

Parameters:
serviceName - The service name to use as the parts to append
Returns:
A new ServiceName

length

public int length()
Get the length (in segments) of this service name.

Returns:
the length

getParent

public ServiceName getParent()
Get the parent (enclosing) service name.

Returns:
the parent name

getSimpleName

public String getSimpleName()
Get the simple (unqualified) name of this service.

Returns:
the simple name

equals

public boolean equals(Object o)
Compare this service name to another service name. This is done by comparing the parents and leaf name of each service name.

Overrides:
equals in class Object
Parameters:
o - the other service name
Returns:
true if they are equal, false if they are not equal or the argument is not a service name or is null

equals

public boolean equals(ServiceName o)
Compare this service name to another service name. This is done by comparing the parents and leaf name of each service name.

Parameters:
o - the other service name
Returns:
true if they are equal, false if they are not equal or the argument is null

hashCode

public int hashCode()
Return the hash code of this service name.

Overrides:
hashCode in class Object
Returns:
the hash code

toString

public String toString()
Get a string representation of this service name.

Overrides:
toString in class Object
Returns:
the string representation

compareTo

public int compareTo(ServiceName o)
Compare two service names lexicographically.

Specified by:
compareTo in interface Comparable<ServiceName>
Parameters:
o - the other name
Returns:
-1 if this name collates before the argument, 1 if it collates after, or 0 if they are equal

JBoss Modular Service Kernel API 1.0.0.Beta1

Copyright © 2010 JBoss, a division of Red Hat, Inc.