com.grafana.foundation.common.TableCellOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grafana-foundation-sdk Show documentation
Show all versions of grafana-foundation-sdk Show documentation
A set of tools, types and libraries for building and manipulating Grafana objects.
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
package com.grafana.foundation.common;
import com.fasterxml.jackson.annotation.JsonUnwrapped;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
// Table cell options. Each cell has a display mode
// and other potential options for that display.
@JsonDeserialize(using = TableCellOptionsDeserializer.class)
public class TableCellOptions {
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@JsonUnwrapped
protected TableAutoCellOptions tableAutoCellOptions;
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@JsonUnwrapped
protected TableSparklineCellOptions tableSparklineCellOptions;
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@JsonUnwrapped
protected TableBarGaugeCellOptions tableBarGaugeCellOptions;
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@JsonUnwrapped
protected TableColoredBackgroundCellOptions tableColoredBackgroundCellOptions;
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@JsonUnwrapped
protected TableColorTextCellOptions tableColorTextCellOptions;
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@JsonUnwrapped
protected TableImageCellOptions tableImageCellOptions;
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@JsonUnwrapped
protected TableJsonViewCellOptions tableJsonViewCellOptions;
protected TableCellOptions() {}
public static TableCellOptions createTableAutoCellOptions(TableAutoCellOptions tableAutoCellOptions) {
TableCellOptions tableCellOptions = new TableCellOptions();
tableCellOptions.tableAutoCellOptions = tableAutoCellOptions;
return tableCellOptions;
}
public static TableCellOptions createTableSparklineCellOptions(com.grafana.foundation.cog.Builder tableSparklineCellOptions) {
TableCellOptions tableCellOptions = new TableCellOptions();
tableCellOptions.tableSparklineCellOptions = tableSparklineCellOptions.build();
return tableCellOptions;
}
public static TableCellOptions createTableBarGaugeCellOptions(com.grafana.foundation.cog.Builder tableBarGaugeCellOptions) {
TableCellOptions tableCellOptions = new TableCellOptions();
tableCellOptions.tableBarGaugeCellOptions = tableBarGaugeCellOptions.build();
return tableCellOptions;
}
public static TableCellOptions createTableColoredBackgroundCellOptions(com.grafana.foundation.cog.Builder tableColoredBackgroundCellOptions) {
TableCellOptions tableCellOptions = new TableCellOptions();
tableCellOptions.tableColoredBackgroundCellOptions = tableColoredBackgroundCellOptions.build();
return tableCellOptions;
}
public static TableCellOptions createTableColorTextCellOptions(TableColorTextCellOptions tableColorTextCellOptions) {
TableCellOptions tableCellOptions = new TableCellOptions();
tableCellOptions.tableColorTextCellOptions = tableColorTextCellOptions;
return tableCellOptions;
}
public static TableCellOptions createTableImageCellOptions(TableImageCellOptions tableImageCellOptions) {
TableCellOptions tableCellOptions = new TableCellOptions();
tableCellOptions.tableImageCellOptions = tableImageCellOptions;
return tableCellOptions;
}
public static TableCellOptions createTableJsonViewCellOptions(TableJsonViewCellOptions tableJsonViewCellOptions) {
TableCellOptions tableCellOptions = new TableCellOptions();
tableCellOptions.tableJsonViewCellOptions = tableJsonViewCellOptions;
return tableCellOptions;
}
public String toJSON() throws JsonProcessingException {
if (tableAutoCellOptions != null) {
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
return ow.writeValueAsString(tableAutoCellOptions);
}
if (tableSparklineCellOptions != null) {
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
return ow.writeValueAsString(tableSparklineCellOptions);
}
if (tableBarGaugeCellOptions != null) {
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
return ow.writeValueAsString(tableBarGaugeCellOptions);
}
if (tableColoredBackgroundCellOptions != null) {
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
return ow.writeValueAsString(tableColoredBackgroundCellOptions);
}
if (tableColorTextCellOptions != null) {
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
return ow.writeValueAsString(tableColorTextCellOptions);
}
if (tableImageCellOptions != null) {
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
return ow.writeValueAsString(tableImageCellOptions);
}
if (tableJsonViewCellOptions != null) {
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
return ow.writeValueAsString(tableJsonViewCellOptions);
}
return null;
}
}