
com.podio.item.map.converter.TextConverter Maven / Gradle / Ivy
package com.podio.item.map.converter;
import java.util.Collections;
import java.util.Map;
import org.apache.commons.beanutils.ConvertUtils;
public class TextConverter implements FieldConverter {
@Override
public Map fromModel(Object value) {
String stringValue = (String) ConvertUtils.convert(value, String.class);
return Collections. singletonMap("value", stringValue);
}
@Override
public Object toModel(Map map, Class modelClass) {
return ConvertUtils.convert(map.get("value"), modelClass);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy