package ejava.examples.uid.ejb;

import java.io.Serializable;

/**
   This class encapsulates the UID value. The current implementation is 
   quite simple. More enterprise solutions would be slightly more complex
   in that they would have to account for multiple id generators.
*/
public final class UID implements Serializable {
   public String value_;

   public UID(String value)                  { value_ = value; }

   public String toString()           { return value_; }
   public int hashCode()              { return value_.hashCode(); }
   public boolean equals(Object rhs)  {
      try {
         return ((UID)rhs).value_.equals(value_);
      }
      catch (Exception ex) {
         return false;
      }
   }
}
