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

com.factset.sdk.IRNConfiguration.models.RatingConfigDto Maven / Gradle / Ivy

There is a newer version: 2.1.1
Show newest version
/*
 * IRN API v1
 * Allows users to extract, create, update and configure IRN data.
 *
 * The version of the OpenAPI document: 1
 * 
 *
 * 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.factset.sdk.IRNConfiguration.models;

import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.jackson.nullable.JsonNullable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.factset.sdk.IRNConfiguration.JSON;


/**
 * RatingConfigDto
 */
@JsonPropertyOrder({
  RatingConfigDto.JSON_PROPERTY_RATINGS_VISIBLE_TO_AUTHOR,
  RatingConfigDto.JSON_PROPERTY_RATINGS_VISIBLE_TO_VIEWERS,
  RatingConfigDto.JSON_PROPERTY_RATINGS_VISIBLE_TO_ALL,
  RatingConfigDto.JSON_PROPERTY_VIEWER_IDS,
  RatingConfigDto.JSON_PROPERTY_OPTION_VALUES
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class RatingConfigDto implements Serializable {
  private static final long serialVersionUID = 1L;

  public static final String JSON_PROPERTY_RATINGS_VISIBLE_TO_AUTHOR = "ratingsVisibleToAuthor";
  private Boolean ratingsVisibleToAuthor;

  public static final String JSON_PROPERTY_RATINGS_VISIBLE_TO_VIEWERS = "ratingsVisibleToViewers";
  private Boolean ratingsVisibleToViewers;

  public static final String JSON_PROPERTY_RATINGS_VISIBLE_TO_ALL = "ratingsVisibleToAll";
  private Boolean ratingsVisibleToAll;

  public static final String JSON_PROPERTY_VIEWER_IDS = "viewerIds";
  private JsonNullable> viewerIds = JsonNullable.>undefined();

  public static final String JSON_PROPERTY_OPTION_VALUES = "optionValues";
  private JsonNullable> optionValues = JsonNullable.>undefined();

  public RatingConfigDto() { 
  }

  public RatingConfigDto ratingsVisibleToAuthor(Boolean ratingsVisibleToAuthor) {
    this.ratingsVisibleToAuthor = ratingsVisibleToAuthor;
    return this;
  }

   /**
   * Get ratingsVisibleToAuthor
   * @return ratingsVisibleToAuthor
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")
  @JsonProperty(JSON_PROPERTY_RATINGS_VISIBLE_TO_AUTHOR)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean getRatingsVisibleToAuthor() {
    return ratingsVisibleToAuthor;
  }


  @JsonProperty(JSON_PROPERTY_RATINGS_VISIBLE_TO_AUTHOR)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setRatingsVisibleToAuthor(Boolean ratingsVisibleToAuthor) {
    this.ratingsVisibleToAuthor = ratingsVisibleToAuthor;
  }


  public RatingConfigDto ratingsVisibleToViewers(Boolean ratingsVisibleToViewers) {
    this.ratingsVisibleToViewers = ratingsVisibleToViewers;
    return this;
  }

   /**
   * Get ratingsVisibleToViewers
   * @return ratingsVisibleToViewers
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")
  @JsonProperty(JSON_PROPERTY_RATINGS_VISIBLE_TO_VIEWERS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean getRatingsVisibleToViewers() {
    return ratingsVisibleToViewers;
  }


  @JsonProperty(JSON_PROPERTY_RATINGS_VISIBLE_TO_VIEWERS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setRatingsVisibleToViewers(Boolean ratingsVisibleToViewers) {
    this.ratingsVisibleToViewers = ratingsVisibleToViewers;
  }


  public RatingConfigDto ratingsVisibleToAll(Boolean ratingsVisibleToAll) {
    this.ratingsVisibleToAll = ratingsVisibleToAll;
    return this;
  }

   /**
   * Get ratingsVisibleToAll
   * @return ratingsVisibleToAll
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")
  @JsonProperty(JSON_PROPERTY_RATINGS_VISIBLE_TO_ALL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean getRatingsVisibleToAll() {
    return ratingsVisibleToAll;
  }


  @JsonProperty(JSON_PROPERTY_RATINGS_VISIBLE_TO_ALL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setRatingsVisibleToAll(Boolean ratingsVisibleToAll) {
    this.ratingsVisibleToAll = ratingsVisibleToAll;
  }


  public RatingConfigDto viewerIds(java.util.List viewerIds) {
    this.viewerIds = JsonNullable.>of(viewerIds);
    return this;
  }

  public RatingConfigDto addViewerIdsItem(java.util.UUID viewerIdsItem) {
    if (this.viewerIds == null || !this.viewerIds.isPresent()) {
      this.viewerIds = JsonNullable.>of(new java.util.ArrayList<>());
    }
    try {
      this.viewerIds.get().add(viewerIdsItem);
    } catch (java.util.NoSuchElementException e) {
      // this can never happen, as we make sure above that the value is present
    }
    return this;
  }

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

  public java.util.List getViewerIds() {
        return viewerIds.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_VIEWER_IDS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public JsonNullable> getViewerIds_JsonNullable() {
    return viewerIds;
  }
  
  @JsonProperty(JSON_PROPERTY_VIEWER_IDS)
  public void setViewerIds_JsonNullable(JsonNullable> viewerIds) {
    this.viewerIds = viewerIds;
  }

  public void setViewerIds(java.util.List viewerIds) {
    this.viewerIds = JsonNullable.>of(viewerIds);
  }


  public RatingConfigDto optionValues(java.util.List optionValues) {
    this.optionValues = JsonNullable.>of(optionValues);
    return this;
  }

  public RatingConfigDto addOptionValuesItem(Integer optionValuesItem) {
    if (this.optionValues == null || !this.optionValues.isPresent()) {
      this.optionValues = JsonNullable.>of(new java.util.ArrayList<>());
    }
    try {
      this.optionValues.get().add(optionValuesItem);
    } catch (java.util.NoSuchElementException e) {
      // this can never happen, as we make sure above that the value is present
    }
    return this;
  }

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

  public java.util.List getOptionValues() {
        return optionValues.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_OPTION_VALUES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public JsonNullable> getOptionValues_JsonNullable() {
    return optionValues;
  }
  
  @JsonProperty(JSON_PROPERTY_OPTION_VALUES)
  public void setOptionValues_JsonNullable(JsonNullable> optionValues) {
    this.optionValues = optionValues;
  }

  public void setOptionValues(java.util.List optionValues) {
    this.optionValues = JsonNullable.>of(optionValues);
  }


  /**
   * Return true if this RatingConfigDto object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    RatingConfigDto ratingConfigDto = (RatingConfigDto) o;
    return Objects.equals(this.ratingsVisibleToAuthor, ratingConfigDto.ratingsVisibleToAuthor) &&
        Objects.equals(this.ratingsVisibleToViewers, ratingConfigDto.ratingsVisibleToViewers) &&
        Objects.equals(this.ratingsVisibleToAll, ratingConfigDto.ratingsVisibleToAll) &&
        equalsNullable(this.viewerIds, ratingConfigDto.viewerIds) &&
        equalsNullable(this.optionValues, ratingConfigDto.optionValues);
  }

  private static  boolean equalsNullable(JsonNullable a, JsonNullable b) {
    return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
  }

  @Override
  public int hashCode() {
    return Objects.hash(ratingsVisibleToAuthor, ratingsVisibleToViewers, ratingsVisibleToAll, hashCodeNullable(viewerIds), hashCodeNullable(optionValues));
  }

  private static  int hashCodeNullable(JsonNullable a) {
    if (a == null) {
      return 1;
    }
    return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class RatingConfigDto {\n");
    sb.append("    ratingsVisibleToAuthor: ").append(toIndentedString(ratingsVisibleToAuthor)).append("\n");
    sb.append("    ratingsVisibleToViewers: ").append(toIndentedString(ratingsVisibleToViewers)).append("\n");
    sb.append("    ratingsVisibleToAll: ").append(toIndentedString(ratingsVisibleToAll)).append("\n");
    sb.append("    viewerIds: ").append(toIndentedString(viewerIds)).append("\n");
    sb.append("    optionValues: ").append(toIndentedString(optionValues)).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