当前位置:网站首页>The IDEA to automatically generate the serialVersionUID
The IDEA to automatically generate the serialVersionUID
2022-08-10 03:32:00 【struggling newbie】
Serialization and Deserialization
Java is an object-oriented language. To interact with other languages (such as HTTP communication with front-end js), it is necessary to convert objects into a common format such as json (the front-end obviously does not recognize Java objects), from objects to json charactersThe conversion of strings is the process of serialization, and conversely, the conversion from json strings to Java objects is the process of deserialization.
What is serialVersionUID
The deserialization process requires generating a Java object from a json string.
There will be a problem at this time. It is necessary to verify whether the input json string is serialized from the current Request class. SerialVersionUID is used for this.When the serialVersionUID during serialization is inconsistent with the serialVersionUID during deserialization, an InvalidCalssException will be thrown.
The specific serialization process is as follows: During the serialization operation, the system will write the serialVersionUID of the current class into the serialized file. When deserializing, the system will detect the serialVersionUID in the file to determine whether it matches the serialization.The serialVersionUID of the current class is consistent. If it is consistent, it means that the version of the serialized class is the same as the current class version, and the deserialization can be successful, otherwise it will fail.
How to generate
First we will implement the interface, so how to automatically generate serialVersionUID.
Set the way to automatically generate serialVersionUID as shown below
After checking as shown in the picture, select the class name, and then press alt+enter to display the options shown below
Once selected, it will generate
边栏推荐
- MySQL: Introduction to Logging System | Error Log | Query Log | Binary Log: Bin-log Data Recovery Practice | Slow Log Query
- 控制台中查看莫格命令的详细信息
- 浅写一个下拉刷新组件
- 微生物是如何影响身体健康的
- 小菜鸟河北联通上岗培训随笔
- idea 删除文件空行
- 在蓝图中给组件动态加子Actor组件
- 2022.8.8 Exam questions for photographer Lao Ma (photographer)
- 数据库治理利器:动态读写分离
- 2022.8.8 Exam area link (district) questions
猜你喜欢
实例045:求和
【二叉树-中等】2265. 统计值等于子树平均值的节点数
【Kali安全渗透测试实践教程】第9章 无线网络渗透
《GB39707-2020》PDF download
数据在内存中的存储
Data Governance (5): Metadata Management
781. 森林中的兔子
Introduction and application of quantitative trading strategies
中级xss绕过【xss Game】
[Kali Security Penetration Testing Practice Tutorial] Chapter 6 Password Attack
随机推荐
Pycharm中6个常用插件推荐
P1564 膜拜
2022.8.9 Exam Unique Bid Auction--800 Question Solutions
2022.8.9考试独特的投标拍卖--800题解
xss的DOMPurify过滤框架:一个循环问题以及两个循环问题
FusionCompute产品介绍
SQLserver adds a judgment
Deep Learning (5) CNN Convolutional Neural Network
【图像分类】2022-ConvMixer ICLR
2022.8.9考试立方和--1100题解
mysql -sql编程
OpenCV图像处理学习四,像素的读写操作和图像反差函数操作
[Kali Security Penetration Testing Practice Course] Chapter 9 Wireless Network Penetration
2022.8.9 Exam arrangement and transformation--1200 questions solution
Open3D 泊松盘网格采样
中级xss绕过【xss Game】
flask增删改查
【图像分类】2022-CycleMLP ICLR
《GB39707-2020》PDF download
idea 删除文件空行