gson-compile/gson-compile-example/src/main/java/io/gitlab/jfronny/gson/Main.java

38 lines
1007 B
Java

package io.gitlab.jfronny.gson;
import io.gitlab.jfronny.gson.annotations.SerializedName;
import io.gitlab.jfronny.gson.compile.annotations.GComment;
import io.gitlab.jfronny.gson.compile.annotations.GSerializable;
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
@GSerializable(generateAdapter = true)
public static class ExamplePojo {
@SerializedName("someBalue")
public String someValue;
@GComment("Yes!")
public Boolean someBool;
@GComment("Halal")
@SerializedName("bingChiller")
public String getBass() {
return "Yes";
}
public ExamplePojo2 nested;
}
@GSerializable
public static class ExamplePojo2 {
@GComment("Yes!")
public boolean primitive;
public ExamplePojo2[] recursiveTest;
}
@GSerializable
public record ExampleRecord(String hello, @GComment("Sheesh") ExamplePojo2 pojo) {
}
}