org.apache.mahout.common
Class StringUtils

java.lang.Object
  extended by org.apache.mahout.common.StringUtils

public final class StringUtils
extends java.lang.Object

Offers two methods to convert an object to a string representation and restore the object given its string representation. Should use Hadoop Stringifier whenever available.


Method Summary
static
<T> T
fromString(java.lang.String str)
          Restores the object from its string representation.
static java.lang.String toString(java.lang.Object obj)
          Converts the object to a one-line string representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toString

public static java.lang.String toString(java.lang.Object obj)
Converts the object to a one-line string representation

Parameters:
obj - the object to convert
Returns:
the string representation of the object

fromString

public static <T> T fromString(java.lang.String str)
Restores the object from its string representation.

Parameters:
str - the string representation of the object
Returns:
restored object


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.