当前位置:网站首页>Fastjason filter field
Fastjason filter field
2022-06-28 09:06:00 【Try Yi yisiwei】
1、 Add... Before the corresponding field of the object transient, Indicates that the field does not need to be serialized , It's generating json This field will not be included when the .
such as
private transient String name;
- 1.
2、 Annotate the object response field , Generated in this way json Also does not contain this field .
@JSONField(serialize=false)
private String name;
- 1.
- 2.
3. The specified field can be displayed
SimplePropertyPreFilter filter = new SimplePropertyPreFilter(
MpBannerEntity.class, "title", "thumbUrl", "url");
JSONObject.toJSONString( Objects to filter ,
filter)
- 1.
- 2.
- 3.
- 4.
4: Filter specified fields
final String[] arr = new String[] { "ticketNo", "status", "updateTime",
"createTime" };
PropertyFilter propertyFilter = new PropertyFilter() {
public boolean apply(Object object, String name, Object value) {
for (String string : arr) {
if (name.equalsIgnoreCase(string)) {
return false;// To filter out
}
}
return true;// No filtering
}
};
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
边栏推荐
- Anniversary party
- 手机买同业存单基金开户选哪家证券公司比较好,比较安全呢
- 从知识到智慧:知识图谱还要走多远?
- 買賣股票費用計算
- Implementation of single sign on
- MySQL8.0 忘记 root 密码
- Apiccloud, together with 360 Tianyu, helps enterprises keep the "first pass" of APP security
- Illustration of MySQL binlog, redo log and undo log
- Construire le premier réseau neuronal avec pytorch et optimiser
- Campus honey decoration of APP course design (e-commerce platform)
猜你喜欢
Mysql8.0 forgot the root password
How to solve the problem of high concurrency and seckill
Discussion on safety management of centralized maintenance construction site of substation under the mode of operation and maintenance
What are the advantages of a differential probe over a conventional probe
Implementation of code scanning login
理解IO模型
数据挖掘建模实战
如何抑制SiC MOSFET Crosstalk(串擾)?
Expérience d'optimisation SQL: de 30248 secondes à 0001 secondes
Guangzhou: new financial activities and new opportunities for enterprises
随机推荐
I want to register my stock account online. How do I do it? Is online account opening safe?
Expérience d'optimisation SQL: de 30248 secondes à 0001 secondes
spark的资源调度和任务调度
Quickly understand JVM structure and working principle
买卖股票费用计算
How do I open an account on my mobile phone? Is it safe to open an account online now?
Copy & Deepcopy
Trailing Zeroes (II)
Almost union find (weighted union search)
Android studio interview preparation
用Pytorch搭建第一个神经网络且进行优化
使用transform:scale之后导致页面鼠标悬浮事件消失
Operating principle of Rogowski coil
DEJA_VU3D - Cesium功能集 之 052-模拟卫星轨道(高空)效果
罗氏线圈工作原理
理解IO模型
How do individuals open accounts to speculate in stocks? Is online account opening safe?
Mysql8.0 forgot the root password
Fire fighting work and measures in Higher Vocational Colleges
Apache Doris becomes the top project of Apache