Generate Java 17 Records and POJO classes with automatic Jackson annotations and Lombok tags
100% Локальные Вычисления в Браузере: Ноль Передач в Облако - Работает Офлайн
JSON to Java POJO & Record Generator
Java POJO100% Локальные Вычисления в Браузере
快速範例:
樣式:
Входная Строка JSON
16 行·325 字元
Сгенерированный Код (Java POJO) 語法正確
import java.util.List;
public class Profile {
private String fullName;
private String avatarUrl;
private String location;
public Profile() {}
public Profile(String fullName, String avatarUrl, String location) {
this.fullName = fullName;
this.avatarUrl = avatarUrl;
this.location = location;
}
public String getFullName() {
return this.fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public String getAvatarUrl() {
return this.avatarUrl;
}
public void setAvatarUrl(String avatarUrl) {
this.avatarUrl = avatarUrl;
}
public String getLocation() {
return this.location;
}
public void setLocation(String location) {
this.location = location;
}
}
public class Root {
private String userId;
private String username;
private String email;
private Boolean isActive;
private Long creditScore;
private Profile profile;
private List<String> roles;
public Root() {}
public Root(String userId, String username, String email, Boolean isActive, Long creditScore, Profile profile, List<String> roles) {
this.userId = userId;
this.username = username;
this.email = email;
this.isActive = isActive;
this.creditScore = creditScore;
this.profile = profile;
this.roles = roles;
}
public String getUserId() {
return this.userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public Boolean getIsActive() {
return this.isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Long getCreditScore() {
return this.creditScore;
}
public void setCreditScore(Long creditScore) {
this.creditScore = creditScore;
}
public Profile getProfile() {
return this.profile;
}
public void setProfile(Profile profile) {
this.profile = profile;
}
public List<String> getRoles() {
return this.roles;
}
public void setRoles(List<String> roles) {
this.roles = roles;
}
}
JSON to Java POJO & Record Generator
Fast client-side offline conversion of JSON strings into Java POJO classes or Java 17+ Record definitions with Jackson annotations.
Часто Задаваемые Вопросы
What is the difference between Java 17 Record and traditional POJO classes?
Java 17 Records are immutable data carriers that automatically generate equals, hashCode, and toString. Traditional POJOs support mutable fields and can pair with Lombok annotations.
Does this generator support Jackson annotations?
Yes, fields receive @JsonProperty annotations for custom naming mappings, ensuring seamless compatibility with Jackson serialization.