package com.rest;
import java.math.BigInteger;
import com.alibaba.fastjson.JSONObject;
import net.sf.cglib.beans.BeanMap;
public class Test {
public static void main(String args[]) {
Pojo pojo = new Pojo();
pojo.setIntValue(1);
pojo.setBigInteger(new BigInteger("2"));
BeanMap map = BeanMap.create(pojo);
System.out.println(map.get("intValue"));
System.out.println(map.keySet());
System.out.println(map.values());
JSONObject owner = new JSONObject();
owner.put("field", "id");
owner.put("filter", "IN_LIST");
owner.put("valueA", "1,2,5,3,8,");
System.out.println(owner.toJSONString());
}
}
class Pojo {
private int intValue;
public int getIntValue() {
return intValue;
}
public void setIntValue(int intValue) {
this.intValue = intValue;
}
public BigInteger getBigInteger() {
return bigInteger;
}
public void setBigInteger(BigInteger bigInteger) {
this.bigInteger = bigInteger;
}
private BigInteger bigInteger;
}
BeanMap的create的使用方法
最新推荐文章于 2022-12-12 16:20:05 发布