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

io.camunda.tasklist.generated.model.DraftSearchVariableValue Maven / Gradle / Ivy

There is a newer version: 8.6.8
Show newest version
/*
 * Tasklist REST API
 * Tasklist is a ready-to-use API application to rapidly implement business processes alongside user tasks in Zeebe.
 *
 * The version of the OpenAPI document: v1
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package io.camunda.tasklist.generated.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.StringJoiner;

/**
 * The draft value of the variable.
 */
@JsonPropertyOrder({
  DraftSearchVariableValue.JSON_PROPERTY_VALUE,
  DraftSearchVariableValue.JSON_PROPERTY_IS_VALUE_TRUNCATED,
  DraftSearchVariableValue.JSON_PROPERTY_PREVIEW_VALUE
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-28T19:05:36.804206600Z[Etc/UTC]", comments = "Generator version: 7.8.0")
public class DraftSearchVariableValue {
  public static final String JSON_PROPERTY_VALUE = "value";
  private String value;

  public static final String JSON_PROPERTY_IS_VALUE_TRUNCATED = "isValueTruncated";
  private Boolean isValueTruncated;

  public static final String JSON_PROPERTY_PREVIEW_VALUE = "previewValue";
  private String previewValue;

  public DraftSearchVariableValue() {
  }

  public DraftSearchVariableValue value(String value) {
    
    this.value = value;
    return this;
  }

  /**
   * The value of the variable.
   * @return value
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_VALUE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getValue() {
    return value;
  }


  @JsonProperty(JSON_PROPERTY_VALUE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setValue(String value) {
    this.value = value;
  }

  public DraftSearchVariableValue isValueTruncated(Boolean isValueTruncated) {
    
    this.isValueTruncated = isValueTruncated;
    return this;
  }

  /**
   * Does the `previewValue` contain the truncated value or full value?
   * @return isValueTruncated
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_IS_VALUE_TRUNCATED)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean getIsValueTruncated() {
    return isValueTruncated;
  }


  @JsonProperty(JSON_PROPERTY_IS_VALUE_TRUNCATED)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setIsValueTruncated(Boolean isValueTruncated) {
    this.isValueTruncated = isValueTruncated;
  }

  public DraftSearchVariableValue previewValue(String previewValue) {
    
    this.previewValue = previewValue;
    return this;
  }

  /**
   * A preview of the variable's value. Limited in size.
   * @return previewValue
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_PREVIEW_VALUE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getPreviewValue() {
    return previewValue;
  }


  @JsonProperty(JSON_PROPERTY_PREVIEW_VALUE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setPreviewValue(String previewValue) {
    this.previewValue = previewValue;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DraftSearchVariableValue draftSearchVariableValue = (DraftSearchVariableValue) o;
    return Objects.equals(this.value, draftSearchVariableValue.value) &&
        Objects.equals(this.isValueTruncated, draftSearchVariableValue.isValueTruncated) &&
        Objects.equals(this.previewValue, draftSearchVariableValue.previewValue);
  }

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

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DraftSearchVariableValue {\n");
    sb.append("    value: ").append(toIndentedString(value)).append("\n");
    sb.append("    isValueTruncated: ").append(toIndentedString(isValueTruncated)).append("\n");
    sb.append("    previewValue: ").append(toIndentedString(previewValue)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

  /**
   * Convert the instance into URL query string.
   *
   * @return URL query string
   */
  public String toUrlQueryString() {
    return toUrlQueryString(null);
  }

  /**
   * Convert the instance into URL query string.
   *
   * @param prefix prefix of the query string
   * @return URL query string
   */
  public String toUrlQueryString(String prefix) {
    String suffix = "";
    String containerSuffix = "";
    String containerPrefix = "";
    if (prefix == null) {
      // style=form, explode=true, e.g. /pet?name=cat&type=manx
      prefix = "";
    } else {
      // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
      prefix = prefix + "[";
      suffix = "]";
      containerSuffix = "]";
      containerPrefix = "[";
    }

    StringJoiner joiner = new StringJoiner("&");

    // add `value` to the URL query string
    if (getValue() != null) {
      try {
        joiner.add(String.format("%svalue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValue()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    // add `isValueTruncated` to the URL query string
    if (getIsValueTruncated() != null) {
      try {
        joiner.add(String.format("%sisValueTruncated%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsValueTruncated()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    // add `previewValue` to the URL query string
    if (getPreviewValue() != null) {
      try {
        joiner.add(String.format("%spreviewValue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPreviewValue()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    return joiner.toString();
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy