//
// $Id: UsernamePasswordCreds.java,v 1.8 2002/09/18 21:58:30 mdb Exp $

package com.threerings.presents.net;

import java.io.IOException;

import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream;

public class UsernamePasswordCreds extends Credentials
{
    /**
     * Zero argument constructor used when unserializing an instance.
     */
    public UsernamePasswordCreds ()
    {
        super();
    }

    /**
     * Construct credentials with the supplied username and password.
     */
    public UsernamePasswordCreds (String username, String password)
    {
        super(username);
        _password = password;
    }

    public String getPassword ()
    {
        return _password;
    }

    /**
     * Writes our custom streamable fields.
     */
    public void writeObject (ObjectOutputStream out)
        throws IOException
    {
        super.writeObject(out);
        out.writeUTF(_password);
    }

    /**
     * Reads our custom streamable fields.
     */
    public void readObject (ObjectInputStream in)
        throws IOException, ClassNotFoundException
    {
        super.readObject(in);
        _password = in.readUTF();
    }

    // documentation inherited
    public int hashCode ()
    {
        return super.hashCode() ^ _password.hashCode();
    }

    // documentation inherited
    public boolean equals (Object other)
    {
        if (other instanceof UsernamePasswordCredentials) {
            UsernamePasswordCredentials upcreds =
                (UsernamePasswordCredentials)other;
            return super.equals(other) &&
                _password.equals(upcreds._password);
        } else {
            return false;
        }
    }

    public String toString ()
    {
        return "[username=" + _username + ", password=" + _password + "]";
    }

    protected String _password;
}

@@ -35,17 +35,17 @@
 ava,v 1.
-8
+9
  2002/09
@@ -53,15 +53,15 @@
 18 2
-1:58:30
+2:06:54
  mdb
@@ -1437,22 +1437,16 @@
 wordCred
-ential
 s) %7B%0A   
@@ -1474,22 +1474,16 @@
 wordCred
-ential
 s upcred
@@ -1485,32 +1485,16 @@
 pcreds =
-%0A               
  (Userna
@@ -1507,22 +1507,16 @@
 wordCred
-ential
 s)other;

Whoopskidoodle.