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

com.clinia.model.common.V1RelationshipWithIncludes Maven / Gradle / Ivy

// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost
// - read more on https://github.com/clinia/api-clients-generation. DO NOT EDIT.

package com.clinia.model.common;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/** V1RelationshipWithIncludes */
@JsonTypeInfo(
  use = JsonTypeInfo.Id.NAME,
  include = JsonTypeInfo.As.EXISTING_PROPERTY,
  property = "type",
  visible = true,
  defaultImpl = V1RelationshipWithIncludes.class
)
public class V1RelationshipWithIncludes {

  @JsonProperty("id")
  private String id;

  @JsonProperty("type")
  private String type;

  @JsonProperty("from")
  private V1RelationshipRef from;

  @JsonProperty("to")
  private V1RelationshipRef to;

  @JsonProperty("meta")
  private V1Meta meta;

  @JsonProperty("data")
  private T data;

  @JsonProperty("includes")
  private Map> includes;

  /**
   * The unique identifier of the relationship. This is a key with the shape
   * `{fromType}.{fromID},{toType}.{toID}`. Key can optionally be passed in the simpler
   * `{fromID},{toID}` form.
   */
  @javax.annotation.Nonnull
  public String getId() {
    return id;
  }

  /** Get type */
  @javax.annotation.Nonnull
  public String getType() {
    return type;
  }

  public V1RelationshipWithIncludes setFrom(V1RelationshipRef from) {
    this.from = from;
    return this;
  }

  /** Get from */
  @javax.annotation.Nonnull
  public V1RelationshipRef getFrom() {
    return from;
  }

  public V1RelationshipWithIncludes setTo(V1RelationshipRef to) {
    this.to = to;
    return this;
  }

  /** Get to */
  @javax.annotation.Nonnull
  public V1RelationshipRef getTo() {
    return to;
  }

  public V1RelationshipWithIncludes setMeta(V1Meta meta) {
    this.meta = meta;
    return this;
  }

  /** Get meta */
  @javax.annotation.Nullable
  public V1Meta getMeta() {
    return meta;
  }

  public V1RelationshipWithIncludes setData(T data) {
    this.data = data;
    return this;
  }

  /** Get data */
  @javax.annotation.Nullable
  public T getData() {
    return data;
  }

  public V1RelationshipWithIncludes setIncludes(Map> includes) {
    this.includes = includes;
    return this;
  }

  public V1RelationshipWithIncludes putIncludes(String key, List includesItem) {
    if (this.includes == null) {
      this.includes = new HashMap<>();
    }
    this.includes.put(key, includesItem);
    return this;
  }

  /** Get includes */
  @javax.annotation.Nullable
  public Map> getIncludes() {
    return includes;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    V1RelationshipWithIncludes v1RelationshipWithIncludes = (V1RelationshipWithIncludes) o;
    return (
      Objects.equals(this.id, v1RelationshipWithIncludes.id) &&
      Objects.equals(this.type, v1RelationshipWithIncludes.type) &&
      Objects.equals(this.from, v1RelationshipWithIncludes.from) &&
      Objects.equals(this.to, v1RelationshipWithIncludes.to) &&
      Objects.equals(this.meta, v1RelationshipWithIncludes.meta) &&
      Objects.equals(this.data, v1RelationshipWithIncludes.data) &&
      Objects.equals(this.includes, v1RelationshipWithIncludes.includes)
    );
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, type, from, to, meta, data, includes);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class V1RelationshipWithIncludes {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    from: ").append(toIndentedString(from)).append("\n");
    sb.append("    to: ").append(toIndentedString(to)).append("\n");
    sb.append("    meta: ").append(toIndentedString(meta)).append("\n");
    sb.append("    data: ").append(toIndentedString(data)).append("\n");
    sb.append("    includes: ").append(toIndentedString(includes)).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    ");
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy