This commit is contained in:
@@ -31,7 +31,6 @@ public class BsonTestMain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main2(String[] args) throws Exception {
|
public static void main2(String[] args) throws Exception {
|
||||||
System.out.println(new String(new byte[]{109, 121, 110, 97, 109, 101}));
|
|
||||||
final BsonConvert convert = BsonFactory.root().getConvert();
|
final BsonConvert convert = BsonFactory.root().getConvert();
|
||||||
SimpleChildEntity entry = SimpleChildEntity.create();
|
SimpleChildEntity entry = SimpleChildEntity.create();
|
||||||
byte[] bytes = convert.convertTo(SimpleEntity.class, entry);
|
byte[] bytes = convert.convertTo(SimpleEntity.class, entry);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.redkale.test.convert;
|
package org.redkale.test.convert;
|
||||||
|
|
||||||
|
import java.net.*;
|
||||||
import org.redkale.convert.ConvertEntity;
|
import org.redkale.convert.ConvertEntity;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@@ -36,6 +37,7 @@ public class SimpleChildEntity extends SimpleEntity {
|
|||||||
map.put("CCC", 333);
|
map.put("CCC", 333);
|
||||||
v.setMap(map);
|
v.setMap(map);
|
||||||
v.setExtend("hahaha");
|
v.setExtend("hahaha");
|
||||||
|
v.setAddr(new InetSocketAddress("127.0.0.1", 6666));
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.redkale.test.convert;
|
package org.redkale.test.convert;
|
||||||
|
|
||||||
|
import java.net.*;
|
||||||
import org.redkale.convert.json.JsonFactory;
|
import org.redkale.convert.json.JsonFactory;
|
||||||
import org.redkale.util.Creator;
|
import org.redkale.util.Creator;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -29,6 +30,8 @@ public class SimpleEntity {
|
|||||||
|
|
||||||
private Map<String, Integer> map;
|
private Map<String, Integer> map;
|
||||||
|
|
||||||
|
private InetSocketAddress addr;
|
||||||
|
|
||||||
public static SimpleEntity create() {
|
public static SimpleEntity create() {
|
||||||
SimpleEntity v = new SimpleEntity();
|
SimpleEntity v = new SimpleEntity();
|
||||||
v.setName("this is name\n \"test");
|
v.setName("this is name\n \"test");
|
||||||
@@ -45,6 +48,7 @@ public class SimpleEntity {
|
|||||||
map.put("BBB", 222);
|
map.put("BBB", 222);
|
||||||
map.put("CCC", 333);
|
map.put("CCC", 333);
|
||||||
v.setMap(map);
|
v.setMap(map);
|
||||||
|
v.setAddr(new InetSocketAddress("127.0.0.1", 6666));
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,6 +70,14 @@ public class SimpleEntity {
|
|||||||
return JsonFactory.root().getConvert().convertTo(this);
|
return JsonFactory.root().getConvert().convertTo(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InetSocketAddress getAddr() {
|
||||||
|
return addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddr(InetSocketAddress addr) {
|
||||||
|
this.addr = addr;
|
||||||
|
}
|
||||||
|
|
||||||
public int[] getAddrs() {
|
public int[] getAddrs() {
|
||||||
return addrs;
|
return addrs;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user