org.apache.xbean.kernel
Class StringServiceName

java.lang.Object
  extended by org.apache.xbean.kernel.StringServiceName
All Implemented Interfaces:
ServiceName

public class StringServiceName
extends Object
implements ServiceName

A simple service name containing a single String.

Since:
2.0
Author:
Dain Sundstrom

Constructor Summary
StringServiceName(String name)
          Create a StringServiceName wrapping specified name.
 
Method Summary
 boolean equals(Object obj)
          A service name must property implement equals.
 int hashCode()
          A service name must properly implement hashCode.
 String toString()
          A service name should return a string from toString that can be used in a String constructor.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringServiceName

public StringServiceName(String name)
Create a StringServiceName wrapping specified name.

Parameters:
name - the name of the service
Method Detail

hashCode

public int hashCode()
Description copied from interface: ServiceName
A service name must properly implement hashCode. For example,

 public int hashCode() {
     int result = 17;
     result = 37 * result + integer;
     result = 37 * result + (object == null ? 0 : object.hashCode());
     return result;
 }
 

Specified by:
hashCode in interface ServiceName
Overrides:
hashCode in class Object
Returns:
the hash code

equals

public boolean equals(Object obj)
Description copied from interface: ServiceName
A service name must property implement equals. For example,

 public boolean equals(Object obj) {
     if (!(obj instanceof MyServiceName)) {
         return false;
     }
     MyServiceName name = (MyServiceName) obj;
     return integer == name.integer &&
             (object == null ? name.object == null : object.equals(name.object));
 }
 

Specified by:
equals in interface ServiceName
Overrides:
equals in class Object
Parameters:
obj - some object
Returns:
true if the object is equivalent to this service name; false otherwise

toString

public String toString()
Description copied from interface: ServiceName
A service name should return a string from toString that can be used in a String constructor.

Specified by:
toString in interface ServiceName
Overrides:
toString in class Object
Returns:
the connonical form of this name


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.