01: /**
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */package com.tc.util;
04:
05: /**
06: * A {@link Stringifier} that uses {@link Object#toString()} to do its work.
07: */
08: public class ToStringStringifier implements Stringifier {
09:
10: public static final ToStringStringifier INSTANCE = new ToStringStringifier();
11:
12: private ToStringStringifier() {
13: // Use INSTANCE instead.
14: }
15:
16: public String toString(Object o) {
17: if (o == null)
18: return "<null>";
19: else
20: return o.toString();
21: }
22:
23: }
|