KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > util > ToStringStringifier


1 /**
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.util;
5
6
7 /**
8  * A {@link Stringifier} that uses {@link Object#toString()} to do its work.
9  */

10 public class ToStringStringifier implements Stringifier {
11   
12   public static final ToStringStringifier INSTANCE = new ToStringStringifier();
13   
14   private ToStringStringifier() {
15     // Use INSTANCE instead.
16
}
17
18   public String JavaDoc toString(Object JavaDoc o) {
19     if (o == null) return "<null>";
20     else return o.toString();
21   }
22
23 }
24
Popular Tags