com.github.debugthug.converters.DoubleConverterTest Maven / Gradle / Ivy
package com.github.debugthug.converters;
import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter;
public class DoubleConverterTest extends AbstractSingleValueConverter {
@SuppressWarnings("rawtypes")
public boolean canConvert(Class type) {
return type.equals(double.class) || type.equals(Double.class);
}
public Object fromString(String str) {
if (str.compareTo("") == 0)
str = "0";
return Double.parseDouble(str);
}
}