当前位置:网站首页>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.
边栏推荐
- [cloud native | kubernetes] in depth understanding of pod (VI)
- A - deep sea exploration
- 数据挖掘建模实战
- Learn how Alibaba manages the data indicator system
- Characteristics and prevention of electrical fire
- SQL 优化经历:从 30248秒到 0.001秒的经历
- Common test method used by testers --- orthogonal method
- Integer partition
- Boundary value analysis method for learning basic content of software testing (2)
- Key points of building fire protection design
猜你喜欢

Decision table method for basic content learning of software testing (2)

Explain observer mode

Discussion on the improvement and application of the prepayment system in the management of electricity charge and price

Resource scheduling and task scheduling of spark

SQL 優化經曆:從 30248秒到 0.001秒的經曆

Implementation of code scanning login

数据挖掘建模实战

与普通探头相比,差分探头有哪些优点

Characteristics and prevention of electrical fire

Deployment of MySQL database in Linux Environment
随机推荐
DEJA_ Vu3d - 051 of cesium function set - perfect realization of terrain excavation
手机炒股开户安不安全?
APICloud携手三六零天御,助力企业守好App安全“第一关”
Common faults and solutions of Substation
Batch modify tables and sorting rules for fields in tables
罗氏线圈工作原理
I want to register my stock account online. How do I do it? Is online account opening safe?
Mysql8.0 forgot the root password
How to solve the problem of high concurrency and seckill
SQL injection file read / write
How to solve the problem of port number occupation
网上炒股开户安不安全?
FatMouse and Cheese
Postman interface test
The Cassandra cluster reinstalls and starts from the node. An error is reported. There is an existing solution
Common test method used by testers --- orthogonal method
Test cases for learning the basic content of software testing (II)
Analysis of prepaid power purchase device
Calcul des frais d'achat et de vente d'actions
Which is a better ERP management system for electronic component sales?