org.apache.xbean.kernel
Class StringServiceName

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

public class StringServiceName
extends java.lang.Object
implements ServiceName

A simple service name containing a single String.

Since:
2.0
Version:
$Id$
Author:
Dain Sundstrom

Constructor Summary
StringServiceName(java.lang.String name)
          Create a StringServiceName wrapping specified name.
 
Method Summary
 boolean equals(java.lang.Object obj)
          A service name must property implement equals.
 int hashCode()
          A service name must properly implement hashCode.
 java.lang.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(java.lang.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

equals

public boolean equals(java.lang.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

toString

public java.lang.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


Copyright © {inceptionYear}-2006 Apache Software Foundation. All Rights Reserved.