com.puresoltechnologies.javafx.preferences.serializers.FontDefinitionPreferenceSerializer Maven / Gradle / Ivy
The newest version!
package com.puresoltechnologies.javafx.preferences.serializers;
import com.puresoltechnologies.javafx.extensions.fonts.FontDefinition;
import com.puresoltechnologies.javafx.extensions.properties.PropertyDefinition;
import com.puresoltechnologies.javafx.preferences.PreferencesSerializer;
public class FontDefinitionPreferenceSerializer implements PreferencesSerializer {
@Override
public boolean isSuitable(PropertyDefinition definition) {
return FontDefinition.class.equals(definition.getType());
}
@Override
public String serialize(FontDefinition object) {
return object.toString();
}
@Override
public FontDefinition deserialize(PropertyDefinition definition, String string) {
return FontDefinition.valueOf(string);
}
}