com.puresoltechnologies.javafx.preferences.serializers.DoublePreferenceSerializer Maven / Gradle / Ivy
package com.puresoltechnologies.javafx.preferences.serializers;
import com.puresoltechnologies.javafx.extensions.properties.PropertyDefinition;
import com.puresoltechnologies.javafx.preferences.PreferencesSerializer;
public class DoublePreferenceSerializer implements PreferencesSerializer {
@Override
public boolean isSuitable(PropertyDefinition definition) {
return Double.class.equals(definition.getType());
}
@Override
public String serialize(Double object) {
return object.toString();
}
@Override
public Double deserialize(PropertyDefinition definition, String string) {
return Double.parseDouble(string);
}
}