com.podio.item.map.converter.TextConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
The official Java wrapper for the Podio API
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);
}
}