org.redkale.convert.ext.CharSequenceSimpledCoder Maven / Gradle / Ivy
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.redkale.convert.ext;
import org.redkale.convert.*;
/**
* CharSequence 的SimpledCoder实现
*
* 详情见: https://redkale.org
* @author zhangjx
* @param Reader输入的子类型
* @param Writer输出的子类型
*/
public class CharSequenceSimpledCoder extends SimpledCoder {
public static final CharSequenceSimpledCoder instance = new CharSequenceSimpledCoder();
@Override
public void convertTo(W out, CharSequence value) {
out.writeString(value == null ? null : value.toString());
}
@Override
public CharSequence convertFrom(R in) {
return in.readString();
}
}