This commit is contained in:
wentch
2015-12-16 16:05:51 +08:00
parent 6e396fa2e0
commit 5f9270ec6a
3 changed files with 35 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ import org.redkale.convert.ext.*;
import org.redkale.util.*;
/**
*
*
* @see http://www.redkale.org
* @author zhangjx
* @param <R>
@@ -82,6 +82,7 @@ public abstract class Factory<R extends Reader, W extends Writer> {
this.register(Number.class, NumberSimpledCoder.instance);
this.register(String.class, StringSimpledCoder.instance);
this.register(CharSequence.class, CharSequenceSimpledCoder.instance);
this.register(java.util.Date.class, DateSimpledCoder.instance);
this.register(BigInteger.class, BigIntegerSimpledCoder.instance);
this.register(InetAddress.class, InetAddressSimpledCoder.instance);

View File

@@ -0,0 +1,29 @@
/*
* 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.*;
/**
*
* @author zhangjx
* @param <R>
* @param <W>
*/
public class CharSequenceSimpledCoder<R extends Reader, W extends Writer> extends SimpledCoder<R, W, CharSequence> {
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();
}
}

View File

@@ -26,7 +26,7 @@ public class RetResult<T> {
}
@Override
public void setRetinfo(String retinfo) {
public void setRetinfo(CharSequence retinfo) {
}
@Override
@@ -38,7 +38,7 @@ public class RetResult<T> {
protected int retcode;
protected String retinfo;
protected CharSequence retinfo;
private T result;
@@ -86,11 +86,11 @@ public class RetResult<T> {
this.retcode = retcode;
}
public String getRetinfo() {
public CharSequence getRetinfo() {
return retinfo;
}
public void setRetinfo(String retinfo) {
public void setRetinfo(CharSequence retinfo) {
this.retinfo = retinfo;
}