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

io.tiledb.cloud.rest_api.model.DimensionTileExtent Maven / Gradle / Ivy

The newest version!
/*
 * TileDB Storage Platform API
 * TileDB Storage Platform REST API
 *
 * The version of the OpenAPI document: 2.2.19
 * 
 *
 * 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.tiledb.cloud.rest_api.model;

import java.util.Objects;

import com.google.gson.TypeAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;

import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;

import io.tiledb.cloud.rest_api.JSON;

/**
 * Extent of tile
 */
@ApiModel(description = "Extent of tile")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-02T12:25:58.319138+03:00[Europe/Athens]")

public class DimensionTileExtent {
  public static final String SERIALIZED_NAME_INT8 = "int8";
  @SerializedName(SERIALIZED_NAME_INT8)
  private Integer int8;

  public static final String SERIALIZED_NAME_UINT8 = "uint8";
  @SerializedName(SERIALIZED_NAME_UINT8)
  private Integer uint8;

  public static final String SERIALIZED_NAME_INT16 = "int16";
  @SerializedName(SERIALIZED_NAME_INT16)
  private Integer int16;

  public static final String SERIALIZED_NAME_UINT16 = "uint16";
  @SerializedName(SERIALIZED_NAME_UINT16)
  private Integer uint16;

  public static final String SERIALIZED_NAME_INT32 = "int32";
  @SerializedName(SERIALIZED_NAME_INT32)
  private Integer int32;

  public static final String SERIALIZED_NAME_UINT32 = "uint32";
  @SerializedName(SERIALIZED_NAME_UINT32)
  private Integer uint32;

  public static final String SERIALIZED_NAME_INT64 = "int64";
  @SerializedName(SERIALIZED_NAME_INT64)
  private Long int64;

  public static final String SERIALIZED_NAME_UINT64 = "uint64";
  @SerializedName(SERIALIZED_NAME_UINT64)
  private Integer uint64;

  public static final String SERIALIZED_NAME_FLOAT32 = "float32";
  @SerializedName(SERIALIZED_NAME_FLOAT32)
  private Integer float32;

  public static final String SERIALIZED_NAME_FLOAT64 = "float64";
  @SerializedName(SERIALIZED_NAME_FLOAT64)
  private Integer float64;

  public DimensionTileExtent() {
  }

  public DimensionTileExtent int8(Integer int8) {
    
    this.int8 = int8;
    return this;
  }

   /**
   * Get int8
   * @return int8
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Integer getInt8() {
    return int8;
  }


  public void setInt8(Integer int8) {
    this.int8 = int8;
  }


  public DimensionTileExtent uint8(Integer uint8) {
    
    this.uint8 = uint8;
    return this;
  }

   /**
   * Get uint8
   * @return uint8
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Integer getUint8() {
    return uint8;
  }


  public void setUint8(Integer uint8) {
    this.uint8 = uint8;
  }


  public DimensionTileExtent int16(Integer int16) {
    
    this.int16 = int16;
    return this;
  }

   /**
   * Get int16
   * @return int16
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Integer getInt16() {
    return int16;
  }


  public void setInt16(Integer int16) {
    this.int16 = int16;
  }


  public DimensionTileExtent uint16(Integer uint16) {
    
    this.uint16 = uint16;
    return this;
  }

   /**
   * Get uint16
   * @return uint16
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Integer getUint16() {
    return uint16;
  }


  public void setUint16(Integer uint16) {
    this.uint16 = uint16;
  }


  public DimensionTileExtent int32(Integer int32) {
    
    this.int32 = int32;
    return this;
  }

   /**
   * Get int32
   * @return int32
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Integer getInt32() {
    return int32;
  }


  public void setInt32(Integer int32) {
    this.int32 = int32;
  }


  public DimensionTileExtent uint32(Integer uint32) {
    
    this.uint32 = uint32;
    return this;
  }

   /**
   * Get uint32
   * @return uint32
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Integer getUint32() {
    return uint32;
  }


  public void setUint32(Integer uint32) {
    this.uint32 = uint32;
  }


  public DimensionTileExtent int64(Long int64) {
    
    this.int64 = int64;
    return this;
  }

   /**
   * Get int64
   * @return int64
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Long getInt64() {
    return int64;
  }


  public void setInt64(Long int64) {
    this.int64 = int64;
  }


  public DimensionTileExtent uint64(Integer uint64) {
    
    this.uint64 = uint64;
    return this;
  }

   /**
   * Get uint64
   * @return uint64
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Integer getUint64() {
    return uint64;
  }


  public void setUint64(Integer uint64) {
    this.uint64 = uint64;
  }


  public DimensionTileExtent float32(Integer float32) {
    
    this.float32 = float32;
    return this;
  }

   /**
   * Get float32
   * @return float32
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Integer getFloat32() {
    return float32;
  }


  public void setFloat32(Integer float32) {
    this.float32 = float32;
  }


  public DimensionTileExtent float64(Integer float64) {
    
    this.float64 = float64;
    return this;
  }

   /**
   * Get float64
   * @return float64
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Integer getFloat64() {
    return float64;
  }


  public void setFloat64(Integer float64) {
    this.float64 = float64;
  }

  /**
   * A container for additional, undeclared properties.
   * This is a holder for any undeclared properties as specified with
   * the 'additionalProperties' keyword in the OAS document.
   */
  private Map additionalProperties;

  /**
   * Set the additional (undeclared) property with the specified name and value.
   * If the property does not already exist, create it otherwise replace it.
   */
  public DimensionTileExtent putAdditionalProperty(String key, Object value) {
    if (this.additionalProperties == null) {
        this.additionalProperties = new HashMap();
    }
    this.additionalProperties.put(key, value);
    return this;
  }

  /**
   * Return the additional (undeclared) property.
   */
  public Map getAdditionalProperties() {
    return additionalProperties;
  }

  /**
   * Return the additional (undeclared) property with the specified name.
   */
  public Object getAdditionalProperty(String key) {
    if (this.additionalProperties == null) {
        return null;
    }
    return this.additionalProperties.get(key);
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DimensionTileExtent dimensionTileExtent = (DimensionTileExtent) o;
    return Objects.equals(this.int8, dimensionTileExtent.int8) &&
        Objects.equals(this.uint8, dimensionTileExtent.uint8) &&
        Objects.equals(this.int16, dimensionTileExtent.int16) &&
        Objects.equals(this.uint16, dimensionTileExtent.uint16) &&
        Objects.equals(this.int32, dimensionTileExtent.int32) &&
        Objects.equals(this.uint32, dimensionTileExtent.uint32) &&
        Objects.equals(this.int64, dimensionTileExtent.int64) &&
        Objects.equals(this.uint64, dimensionTileExtent.uint64) &&
        Objects.equals(this.float32, dimensionTileExtent.float32) &&
        Objects.equals(this.float64, dimensionTileExtent.float64)&&
        Objects.equals(this.additionalProperties, dimensionTileExtent.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DimensionTileExtent {\n");
    sb.append("    int8: ").append(toIndentedString(int8)).append("\n");
    sb.append("    uint8: ").append(toIndentedString(uint8)).append("\n");
    sb.append("    int16: ").append(toIndentedString(int16)).append("\n");
    sb.append("    uint16: ").append(toIndentedString(uint16)).append("\n");
    sb.append("    int32: ").append(toIndentedString(int32)).append("\n");
    sb.append("    uint32: ").append(toIndentedString(uint32)).append("\n");
    sb.append("    int64: ").append(toIndentedString(int64)).append("\n");
    sb.append("    uint64: ").append(toIndentedString(uint64)).append("\n");
    sb.append("    float32: ").append(toIndentedString(float32)).append("\n");
    sb.append("    float64: ").append(toIndentedString(float64)).append("\n");
    sb.append("    additionalProperties: ").append(toIndentedString(additionalProperties)).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    ");
  }


  public static HashSet openapiFields;
  public static HashSet openapiRequiredFields;

  static {
    // a set of all properties/fields (JSON key names)
    openapiFields = new HashSet();
    openapiFields.add("int8");
    openapiFields.add("uint8");
    openapiFields.add("int16");
    openapiFields.add("uint16");
    openapiFields.add("int32");
    openapiFields.add("uint32");
    openapiFields.add("int64");
    openapiFields.add("uint64");
    openapiFields.add("float32");
    openapiFields.add("float64");

    // a set of required properties/fields (JSON key names)
    openapiRequiredFields = new HashSet();
  }

 /**
  * Validates the JSON Object and throws an exception if issues found
  *
  * @param jsonObj JSON Object
  * @throws IOException if the JSON Object is invalid with respect to DimensionTileExtent
  */
  public static void validateJsonObject(JsonObject jsonObj) throws IOException {
      if (jsonObj == null) {
        if (DimensionTileExtent.openapiRequiredFields.isEmpty()) {
          return;
        } else { // has required fields
          throw new IllegalArgumentException(String.format("The required field(s) %s in DimensionTileExtent is not found in the empty JSON string", DimensionTileExtent.openapiRequiredFields.toString()));
        }
      }
  }

  public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")
    @Override
    public  TypeAdapter create(Gson gson, TypeToken type) {
       if (!DimensionTileExtent.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'DimensionTileExtent' and its subtypes
       }
       final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(DimensionTileExtent.class));

       return (TypeAdapter) new TypeAdapter() {
           @Override
           public void write(JsonWriter out, DimensionTileExtent value) throws IOException {
             JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
             obj.remove("additionalProperties");
             // serialize additonal properties
             if (value.getAdditionalProperties() != null) {
               for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
                 if (entry.getValue() instanceof String)
                   obj.addProperty(entry.getKey(), (String) entry.getValue());
                 else if (entry.getValue() instanceof Number)
                   obj.addProperty(entry.getKey(), (Number) entry.getValue());
                 else if (entry.getValue() instanceof Boolean)
                   obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
                 else if (entry.getValue() instanceof Character)
                   obj.addProperty(entry.getKey(), (Character) entry.getValue());
                 else {
                   obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
                 }
               }
             }
             elementAdapter.write(out, obj);
           }

           @Override
           public DimensionTileExtent read(JsonReader in) throws IOException {
             JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
             validateJsonObject(jsonObj);
             // store additional fields in the deserialized instance
             DimensionTileExtent instance = thisAdapter.fromJsonTree(jsonObj);
             for (Map.Entry entry : jsonObj.entrySet()) {
               if (!openapiFields.contains(entry.getKey())) {
                 if (entry.getValue().isJsonPrimitive()) { // primitive type
                   if (entry.getValue().getAsJsonPrimitive().isString())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
                   else if (entry.getValue().getAsJsonPrimitive().isNumber())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
                   else if (entry.getValue().getAsJsonPrimitive().isBoolean())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
                   else
                     throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
                 } else { // non-primitive type
                   instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
                 }
               }
             }
             return instance;
           }

       }.nullSafe();
    }
  }

 /**
  * Create an instance of DimensionTileExtent given an JSON string
  *
  * @param jsonString JSON string
  * @return An instance of DimensionTileExtent
  * @throws IOException if the JSON string is invalid with respect to DimensionTileExtent
  */
  public static DimensionTileExtent fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, DimensionTileExtent.class);
  }

 /**
  * Convert an instance of DimensionTileExtent to an JSON string
  *
  * @return JSON string
  */
  public String toJson() {
    return JSON.getGson().toJson(this);
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy