com.grafana.foundation.common.MapLayerOptions 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.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
public class MapLayerOptions {
@JsonProperty("type")
public String type;
// configured unique display name
@JsonProperty("name")
public String name;
// Custom options depending on the type
@JsonProperty("config")
public Object config;
// Common method to define geometry fields
@JsonProperty("location")
public FrameGeometrySource location;
// Defines a frame MatcherConfig that may filter data for the given layer
@JsonProperty("filterData")
public Object filterData;
// Common properties:
// https://openlayers.org/en/latest/apidoc/module-ol_layer_Base-BaseLayer.html
// Layer opacity (0-1)
@JsonProperty("opacity")
public Long opacity;
// Check tooltip (defaults to true)
@JsonProperty("tooltip")
public Boolean tooltip;
public String toJSON() throws JsonProcessingException {
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
return ow.writeValueAsString(this);
}
public static class Builder implements com.grafana.foundation.cog.Builder {
private final MapLayerOptions internal;
public Builder() {
this.internal = new MapLayerOptions();
}
public Builder type(String type) {
this.internal.type = type;
return this;
}
public Builder name(String name) {
this.internal.name = name;
return this;
}
public Builder config(Object config) {
this.internal.config = config;
return this;
}
public Builder location(com.grafana.foundation.cog.Builder location) {
this.internal.location = location.build();
return this;
}
public Builder filterData(Object filterData) {
this.internal.filterData = filterData;
return this;
}
public Builder opacity(Long opacity) {
this.internal.opacity = opacity;
return this;
}
public Builder tooltip(Boolean tooltip) {
this.internal.tooltip = tooltip;
return this;
}
public MapLayerOptions build() {
return this.internal;
}
}
}