Newer
Older
commitconf24 / snippets / Json.java
@Antonio Muñoz Antonio Muñoz on 8 Feb 2024 451 bytes add snippets
package snippets;

import java.util.List;
import java.util.Map;

public sealed interface Json {
    enum JsonNull implements Json {
        NULL
    }
    enum JsonBoolean implements Json {
        TRUE, FALSE
    }
    record JsonString(String value) implements Json {}
    record JsonNumber(Number value) implements Json {}
    record JsonObject(Map<String, Json> value) implements Json {}
    record JsonArray(List<Json> value) implements Json {}
}