All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datadog.api.v1.client.model.WidgetMessageDisplay Maven / Gradle / Ivy

/*
 * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
 * This product includes software developed at Datadog (https://www.datadoghq.com/).
 * Copyright 2019-Present Datadog, Inc.
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package com.datadog.api.v1.client.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

/** Amount of log lines to display */
@JsonSerialize(using = WidgetMessageDisplay.WidgetMessageDisplaySerializer.class)
public class WidgetMessageDisplay {

  public static final WidgetMessageDisplay INLINE = new WidgetMessageDisplay("inline");
  public static final WidgetMessageDisplay EXPANDED_MEDIUM =
      new WidgetMessageDisplay("expanded-md");
  public static final WidgetMessageDisplay EXPANDED_LARGE = new WidgetMessageDisplay("expanded-lg");

  private static final Set allowedValues =
      new HashSet(Arrays.asList("inline", "expanded-md", "expanded-lg"));

  private String value;

  public boolean isValid() {
    return allowedValues.contains(this.value);
  }

  WidgetMessageDisplay(String value) {
    this.value = value;
  }

  public static class WidgetMessageDisplaySerializer extends StdSerializer {
    public WidgetMessageDisplaySerializer(Class t) {
      super(t);
    }

    public WidgetMessageDisplaySerializer() {
      this(null);
    }

    @Override
    public void serialize(
        WidgetMessageDisplay value, JsonGenerator jgen, SerializerProvider provider)
        throws IOException, JsonProcessingException {
      jgen.writeObject(value.value);
    }
  }

  @JsonValue
  public String getValue() {
    return this.value;
  }

  public void setValue(String value) {
    this.value = value;
  }

  /** Return true if this WidgetMessageDisplay object is equal to o. */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    return this.value.equals(((WidgetMessageDisplay) o).value);
  }

  @Override
  public int hashCode() {
    return Objects.hash(value);
  }

  @Override
  public String toString() {
    return String.valueOf(value);
  }

  @JsonCreator
  public static WidgetMessageDisplay fromValue(String value) {
    return new WidgetMessageDisplay(value);
  }
}




© 2015 - 2026 Weber Informatics LLC | Privacy Policy