// Path: kibana-generator/src/main/java/core/util/JSON.java
// public class JSON {
//     private static final ObjectMapper OBJECT_MAPPER = createObjectMapper();
// 
//     private static ObjectMapper createObjectMapper() {
//         return JsonMapper.builder()
//                 .defaultDateFormat(new StdDateFormat())
//                 .serializationInclusion(JsonInclude.Include.NON_NULL)
// //                .enable(SerializationFeature.INDENT_OUTPUT)
//                 .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS)
//                 .deactivateDefaultTyping()
//                 .build();
//     }
// 
//     public static String toJSON(Object instance) {
//         try {
//             return OBJECT_MAPPER.writeValueAsString(instance);
//         } catch (IOException e) {
//             throw new UncheckedIOException(e);
//         }
//     }
// }


import core.util.JSON;
package core.kibana;


/**
 * @author neo
 */
public class KibanaObject {
    static KibanaObject visualization(TSVB tsvb) {
        var visualization = new KibanaObject();
        visualization.id = tsvb.title;
        visualization.type = "visualization";
        visualization.attributes.title = tsvb.title;
// Path: kibana-generator/src/main/java/core/util/JSON.java
// public class JSON {
//     private static final ObjectMapper OBJECT_MAPPER = createObjectMapper();
// 
//     private static ObjectMapper createObjectMapper() {
//         return JsonMapper.builder()
//                 .defaultDateFormat(new StdDateFormat())
//                 .serializationInclusion(JsonInclude.Include.NON_NULL)
// //                .enable(SerializationFeature.INDENT_OUTPUT)
//                 .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS)
//                 .deactivateDefaultTyping()
//                 .build();
//     }
// 
//     public static String toJSON(Object instance) {
//         try {
//             return OBJECT_MAPPER.writeValueAsString(instance);
//         } catch (IOException e) {
//             throw new UncheckedIOException(e);
//         }
//     }
// }


// Path: kibana-generator/src/main/java/core/kibana/KibanaObject.java
import core.util.JSON;

package core.kibana;


/**
 * @author neo
 */
public class KibanaObject {
    static KibanaObject visualization(TSVB tsvb) {
        var visualization = new KibanaObject();
        visualization.id = tsvb.title;
        visualization.type = "visualization";
        visualization.attributes.title = tsvb.title;
        visualization.attributes.visState = JSON.toJSON(tsvb);