Modified DObject.toString() to use fieldsToString() so that all of its

derived classes need not do their own toString()ing.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@928 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-02-04 01:47:20 +00:00
parent 5bb4e3435b
commit a83e512270
8 changed files with 12 additions and 76 deletions
@@ -1,5 +1,5 @@
//
// $Id: BodyObject.dobj,v 1.6 2002/02/03 03:09:06 mdb Exp $
// $Id: BodyObject.dobj,v 1.7 2002/02/04 01:47:20 mdb Exp $
package com.threerings.crowd.data;
@@ -45,11 +45,4 @@ public class BodyObject extends ClientObject
this.location = location;
requestAttributeChange(LOCATION, new Integer(location));
}
protected void toString (StringBuffer buf)
{
super.toString(buf);
buf.append(", username=").append(username);
buf.append(", location=").append(location);
}
}
@@ -1,5 +1,5 @@
//
// $Id: PlaceObject.dobj,v 1.6 2001/10/11 04:07:51 mdb Exp $
// $Id: PlaceObject.dobj,v 1.7 2002/02/04 01:47:20 mdb Exp $
package com.threerings.crowd.data;
@@ -70,11 +70,4 @@ public class PlaceObject extends DObject
{
requestElementUpdate(OCCUPANT_INFO, elem);
}
protected void toString (StringBuffer buf)
{
super.toString(buf);
buf.append(", occupants=").append(occupants);
buf.append(", occupantInfo=").append(occupantInfo);
}
}
@@ -1,5 +1,5 @@
//
// $Id: MiCasaBootstrapData.java,v 1.2 2001/10/11 04:13:33 mdb Exp $
// $Id: MiCasaBootstrapData.java,v 1.3 2002/02/04 01:47:20 mdb Exp $
package com.threerings.micasa.data;
@@ -13,11 +13,4 @@ public class MiCasaBootstrapData extends BootstrapData
{
/** The oid of the default lobby. */
public int defLobbyOid;
// documentation inherited
public void toString (StringBuffer buf)
{
super.toString(buf);
buf.append(", defLobbyOid=").append(defLobbyOid);
}
}
@@ -1,5 +1,5 @@
//
// $Id: GameObject.dobj,v 1.5 2001/10/17 02:48:57 mdb Exp $
// $Id: GameObject.dobj,v 1.6 2002/02/04 01:47:20 mdb Exp $
package com.threerings.parlor.game;
@@ -70,13 +70,4 @@ public class GameObject extends PlaceObject
{
requestAttributeChange(PLAYERS, value);
}
// documentation inherited
protected void toString (StringBuffer buf)
{
super.toString(buf);
buf.append(", state=").append(state);
buf.append(", isRated=").append(isRated);
buf.append(", players=").append(StringUtil.toString(players));
}
}
@@ -1,5 +1,5 @@
//
// $Id: TurnGameObject.dobj,v 1.2 2001/10/17 02:49:37 mdb Exp $
// $Id: TurnGameObject.dobj,v 1.3 2002/02/04 01:47:20 mdb Exp $
package com.threerings.parlor.turn;
@@ -24,11 +24,4 @@ public class TurnGameObject extends GameObject
{
requestAttributeChange(TURN_HOLDER, turnHolder);
}
// documentation inherited
protected void toString (StringBuffer buf)
{
super.toString(buf);
buf.append(", turnHolder=").append(turnHolder);
}
}
@@ -1,5 +1,5 @@
//
// $Id: DObject.java,v 1.35 2002/02/04 00:51:15 mdb Exp $
// $Id: DObject.java,v 1.36 2002/02/04 01:47:19 mdb Exp $
package com.threerings.presents.dobj;
@@ -7,6 +7,7 @@ import java.lang.reflect.Field;
import java.util.ArrayList;
import com.samskivert.util.ListUtil;
import com.samskivert.util.StringUtil;
import com.threerings.presents.Log;
/**
@@ -444,22 +445,9 @@ public class DObject
public String toString ()
{
StringBuffer buf = new StringBuffer();
buf.append("[");
toString(buf);
buf.append("]");
return buf.toString();
}
/**
* An extensible mechanism for generating a string representation of
* this object. Derived classes should override this method, calling
* super and then appending their own data to the supplied string
* buffer. The regular {@link #toString} function will call this
* derived function to generate its string.
*/
protected void toString (StringBuffer buf)
{
buf.append("oid=").append(_oid);
buf.append("[oid=").append(_oid).append(", ");
StringUtil.fieldsToString(this);
return buf.append("]").toString();
}
/**
@@ -1,5 +1,5 @@
//
// $Id: AuthResponseData.java,v 1.9 2001/10/11 04:07:53 mdb Exp $
// $Id: AuthResponseData.java,v 1.10 2002/02/04 01:47:20 mdb Exp $
package com.threerings.presents.net;
@@ -21,11 +21,4 @@ public class AuthResponseData extends DObject
* why the authentication failed.
*/
public String code;
// documentation inherited
protected void toString (StringBuffer buf)
{
super.toString(buf);
buf.append(", code=").append(code);
}
}
@@ -1,5 +1,5 @@
//
// $Id: BootstrapData.java,v 1.3 2001/10/11 04:07:53 mdb Exp $
// $Id: BootstrapData.java,v 1.4 2002/02/04 01:47:20 mdb Exp $
package com.threerings.presents.net;
@@ -18,12 +18,4 @@ public class BootstrapData extends DObject
/** The oid to which to send invocation requests. */
public int invOid;
// documentation inherited
public void toString (StringBuffer buf)
{
super.toString(buf);
buf.append(", clientOid=").append(clientOid);
buf.append(", invOid=").append(invOid);
}
}