// 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
// 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);
//     return visualization;
// }


import core.util.JSON;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import static core.kibana.KibanaObject.visualization;
package core.kibana;




/**
 * @author neo
 */
public class KibanaObjectBuilder {
    private static final String[] COLOR_PALETTE = new String[]{
            "#F94144", "#F3722C", "#F8961E", "#F9844A", "#F9C74F",
            "#90BE6D", "#43AA8B", "#4D908E", "#577590", "#277DA1"
    };
    final List<KibanaObject> objects = new ArrayList<>();
    private int colorIndex;

    public String build() {
        buildVisualization();
// 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
// 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);
//     return visualization;
// }


// Path: kibana-generator/src/main/java/core/kibana/KibanaObjectBuilder.java
import core.util.JSON;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import static core.kibana.KibanaObject.visualization;

package core.kibana;




/**
 * @author neo
 */
public class KibanaObjectBuilder {
    private static final String[] COLOR_PALETTE = new String[]{
            "#F94144", "#F3722C", "#F8961E", "#F9844A", "#F9C74F",
            "#90BE6D", "#43AA8B", "#4D908E", "#577590", "#277DA1"
    };
    final List<KibanaObject> objects = new ArrayList<>();
    private int colorIndex;

    public String build() {
        buildVisualization();
        return JSON.toJSON(objects);