This commit is contained in:
@@ -82,6 +82,7 @@ public abstract class Factory<R extends Reader, W extends Writer> {
|
|||||||
|
|
||||||
this.register(Number.class, NumberSimpledCoder.instance);
|
this.register(Number.class, NumberSimpledCoder.instance);
|
||||||
this.register(String.class, StringSimpledCoder.instance);
|
this.register(String.class, StringSimpledCoder.instance);
|
||||||
|
this.register(CharSequence.class, CharSequenceSimpledCoder.instance);
|
||||||
this.register(java.util.Date.class, DateSimpledCoder.instance);
|
this.register(java.util.Date.class, DateSimpledCoder.instance);
|
||||||
this.register(BigInteger.class, BigIntegerSimpledCoder.instance);
|
this.register(BigInteger.class, BigIntegerSimpledCoder.instance);
|
||||||
this.register(InetAddress.class, InetAddressSimpledCoder.instance);
|
this.register(InetAddress.class, InetAddressSimpledCoder.instance);
|
||||||
|
|||||||
29
src/org/redkale/convert/ext/CharSequenceSimpledCoder.java
Normal file
29
src/org/redkale/convert/ext/CharSequenceSimpledCoder.java
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,7 +26,7 @@ public class RetResult<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRetinfo(String retinfo) {
|
public void setRetinfo(CharSequence retinfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -38,7 +38,7 @@ public class RetResult<T> {
|
|||||||
|
|
||||||
protected int retcode;
|
protected int retcode;
|
||||||
|
|
||||||
protected String retinfo;
|
protected CharSequence retinfo;
|
||||||
|
|
||||||
private T result;
|
private T result;
|
||||||
|
|
||||||
@@ -86,11 +86,11 @@ public class RetResult<T> {
|
|||||||
this.retcode = retcode;
|
this.retcode = retcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRetinfo() {
|
public CharSequence getRetinfo() {
|
||||||
return retinfo;
|
return retinfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRetinfo(String retinfo) {
|
public void setRetinfo(CharSequence retinfo) {
|
||||||
this.retinfo = retinfo;
|
this.retinfo = retinfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user