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

com.clinia.model.common.V1Relationship 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.Objects;

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

  @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;

  /**
   * 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 V1Relationship setFrom(V1RelationshipRef from) {
    this.from = from;
    return this;
  }

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

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

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

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

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

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

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

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

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

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class V1Relationship {\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("}");
    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