All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.podio.item.map.converter.TextConverter Maven / Gradle / Ivy

There is a newer version: 0.7.9
Show newest version
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 - 2024 Weber Informatics LLC | Privacy Policy