public class User {
private String name;
private int age;
}
Moshi moshi = new Moshi.Builder().build();
JsonAdapter<User> jsonAdapter = moshi.adapter(User.class);
User user = new User("John Doe", 25);
String jsonString = jsonAdapter.toJson(user);
String jsonString = "{\"name\":\"John Doe\",\"age\":25}";
User user = jsonAdapter.fromJson(jsonString);