com.activeandroid.serializer.BigDecimalSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of activeandroidrx Show documentation
Show all versions of activeandroidrx Show documentation
ActiveAndroid fork with reactive extensions.
package com.activeandroid.serializer;
import java.math.BigDecimal;
public final class BigDecimalSerializer extends TypeSerializer {
public Class> getDeserializedType() {
return BigDecimal.class;
}
public Class> getSerializedType() {
return String.class;
}
public String serialize(Object data) {
if (data == null) {
return null;
}
return ((BigDecimal) data).toString();
}
public BigDecimal deserialize(Object data) {
if (data == null) {
return null;
}
return new BigDecimal((String) data);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy