/**
 * <p>Domain Value Object: Address Type.</p>
 * <p>Description: A typesafe enumeration of address types as defined
 * in our corporate Business Object Model.</p>
 */
public final class AddrType implements TypeSafeEnum
{
   // the COMPLETE list of values...
   static public final AddrType kPhysical = new AddrType("P");
   static public final AddrType kBilling  = new AddrType("B");
   static public final AddrType kShipping = new AddrType("S");
   static public final AddrType kMailing  = new AddrType("M");
   static public final AddrType kFormer   = new AddrType("F");
   static public final AddrType kUnknown  = new AddrType(" ");

   // instance info...
   private AddrType( String name ){ this.name = name; }
   public  String toString(){ return name; }

   /** The value. Must be non-null.
    * @serial
    */
   private final String name;		// maps to VARCHAR2(1)

   // support serialization...
   static private final long serialVersionUID = 1;
   static private final AddrType[] _Items =
   { kPhysical, kBilling, kShipping, kMailing, kFormer, kUnknown, null };

   static public AddrType AsAddrType( String token )
   {
      if (token==null) return null;
      for (int i=0; i<_Items.length; ++i)
        if (token.equals(_Items[i].name)) return _Items[i];
      return null;
   }

   private Object readResolve() throws java.io.ObjectStreamException
   { return AsAddrType( name ); }
}
