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

37 lines
942 B
Java
Raw Normal View History

2022-10-31 20:52:48 +01:00
package io.gitlab.jfronny.gson;
2022-11-01 10:08:03 +01:00
import io.gitlab.jfronny.gson.annotations.SerializedName;
import io.gitlab.jfronny.gson.compile.annotations.GComment;
2022-10-31 20:52:48 +01:00
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 {
2022-11-01 10:08:03 +01:00
@SerializedName("someBalue")
2022-10-31 20:52:48 +01:00
public String someValue;
2022-11-01 10:08:03 +01:00
@GComment("Yes!")
2022-10-31 20:52:48 +01:00
public Boolean someBool;
2022-11-01 10:08:03 +01:00
@GComment("Halal")
@SerializedName("bingChiller")
public String getBass() {
return "Yes";
}
public ExamplePojo2 nested;
}
@GSerializable
public static class ExamplePojo2 {
@GComment("Yes!")
public boolean primitive;
2022-10-31 20:52:48 +01:00
}
2022-11-01 11:50:02 +01:00
@GSerializable
public record ExampleRecord(String hello, ExamplePojo2 pojo) {
}
2022-10-31 20:52:48 +01:00
}