Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thierrysquirrel/ants
ants
https://github.com/thierrysquirrel/ants
ants
Last synced: 8 days ago
JSON representation
ants
- Host: GitHub
- URL: https://github.com/thierrysquirrel/ants
- Owner: ThierrySquirrel
- License: apache-2.0
- Created: 2021-11-03T11:26:20.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-08-08T01:36:44.000Z (3 months ago)
- Last Synced: 2024-08-08T03:49:33.019Z (3 months ago)
- Topics: ants
- Language: Java
- Homepage:
- Size: 111 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ants
Serialization tool
[中文](./README_zh_CN.md)
Support Function:
- [x] Domain object serialization# Domain object serialization:
Serialize domain objects using a more space efficient algorithm .
Support data types (8 basic data types of packaging)Byte,Short,Integer,Long,Float,Double,Boolean,Character,
String,Enum,Domain.
Object(8 basic data types of packaging,String,Enum,Domain),
byte[].
((Arrays,List,Map):'(8 basic data types of packaging+String,Enum,Domain.If Object is used, only 8 basic data types are supported +String)').## Quick Start
```xml
com.github.thierrysquirrel
ants
1.1.0.0-RELEASE
```# Domain object serialization
```java
@Data
public class User {
private Byte aByte;
private Short aShort;
private Integer aInteger;
private Long aLong;
private Float aFloat;
private Double aDouble;
private Boolean aBoolean;
private Character character;
public static void main(String[] args) {
User user = getUser ();
byte[] serialize = AntsUtils.serialize (user);
User user1 = AntsUtils.deSerialize (serialize, User.class);
System.out.println (user);
System.out.println (user1);
System.out.println (user==user1);
}
public static User getUser(){
User user=new User ();
user.setAByte ((byte) 1);
user.setAShort ((short) 2);
user.setAInteger (3);
user.setALong (4L);
user.setAFloat (5.5F);
user.setADouble (6.6);
user.setABoolean (Boolean.TRUE);
user.setCharacter ('A');
return user;
}
}
```![Russian flag](https://user-images.githubusercontent.com/49895274/190374600-65baa531-61b0-47e8-8862-1038cb1b45bb.png)