Show
Ignore:
Timestamp:
03/07/09 20:06:15 (3 years ago)
Author:
amandel
Message:

New utility methods.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/java/org/jcoderz/commons/util/ObjectUtil.java

    r1011 r1286  
    136136      return obj == null ? null : obj.toString(); 
    137137   } 
     138 
     139   /** 
     140    * Returns the string representation of the object or 
     141    * an empty string if the object is null. 
     142    * @param obj the object to be converted or <code>null</code>. 
     143    * @return the string representation of the object or 
     144    * an empty string if the object is null. 
     145    */ 
     146   public static String toStringOrEmpty (Object obj) 
     147   { 
     148      return obj == null ? "" : obj.toString(); 
     149   } 
    138150}