<dependency>
<groupId>net.arnx</groupId>
<artifactId>jsonic</artifactId>
<version>1.4.5</version>
</dependency>
import net.arnx.jsonic.JSON;
public class Person {
private String name;
private int age;
public Person(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
}
public class Main {
public static void main(String[] args) {
Person person = new Person("John", 25);
String json = JSON.encode(person);
Person decodedPerson = JSON.decode(json, Person.class);
}
}