
com.influxdb.client.domain.UnaryExpression Maven / Gradle / Ivy
/*
* InfluxDB OSS API Service
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
*
* 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.influxdb.client.domain;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.influxdb.client.domain.Expression;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
/**
* Uses operators to act on a single operand in an expression
*/
public class UnaryExpression extends Expression {
public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
private String type;
public static final String SERIALIZED_NAME_OPERATOR = "operator";
@SerializedName(SERIALIZED_NAME_OPERATOR)
private String operator;
public static final String SERIALIZED_NAME_ARGUMENT = "argument";
@SerializedName(SERIALIZED_NAME_ARGUMENT)
@JsonAdapter(UnaryExpressionArgumentAdapter.class)
private Expression argument = null;
public UnaryExpression type(String type) {
this.type = type;
return this;
}
/**
* Type of AST node
* @return type
**/
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public UnaryExpression operator(String operator) {
this.operator = operator;
return this;
}
/**
* Get operator
* @return operator
**/
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
public UnaryExpression argument(Expression argument) {
this.argument = argument;
return this;
}
/**
* Get argument
* @return argument
**/
public Expression getArgument() {
return argument;
}
public void setArgument(Expression argument) {
this.argument = argument;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UnaryExpression unaryExpression = (UnaryExpression) o;
return Objects.equals(this.type, unaryExpression.type) &&
Objects.equals(this.operator, unaryExpression.operator) &&
Objects.equals(this.argument, unaryExpression.argument) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(type, operator, argument, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UnaryExpression {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" operator: ").append(toIndentedString(operator)).append("\n");
sb.append(" argument: ").append(toIndentedString(argument)).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(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static class UnaryExpressionArgumentAdapter implements JsonDeserializer
© 2015 - 2025 Weber Informatics LLC | Privacy Policy