Double getFactor(@p("asset id") String id) {
double factor = getFactor(id); // do some maths here ...
if (Double.isNaN(factor)) {
throw new IllegalArgumentException("NaN is not a valid double value as per JSON specification. To override this behavior, use GsonBuilder.serializeSpecialFloatingPointValues() method.");
}
return factor;
}
1条答案
按热度按时间kokeuurv1#
你好,algotechnology,在这种情况下,你期望如何序列化它?"NaN"字符串?