Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package de.zalando.typemapper.core.fieldMapper;
 
 
 public class CharFieldMapper implements FieldMapper {
 
     private static final Logger LOG = LoggerFactory.getLogger(CharFieldMapper.class);
 
    @Override
    public Object mapField(final String stringfinal Class clazz) {
        if (string == null) {
            return null;
        }
        if (string.length() == 1) {
            return string.charAt(0);
        } else {
            .error("Could not convert {} to char."string);
        }
        return null;
    }
New to GrepCode? Check out our FAQ X