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

openapitools.model.Campaign Maven / Gradle / Ivy

The newest version!
/*
 * Product Base Definitions
 * This component represents the Open API interface of the accounting service. 
 *
 * The version of the OpenAPI document: 0.0.1
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package openapitools.model;

import java.util.Objects;
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 java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.openapitools.jackson.nullable.JsonNullable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import openapitools.JSON;


/**
 * Campaign
 */
@JsonPropertyOrder({
  Campaign.JSON_PROPERTY_THE_LINK_I_D,
  Campaign.JSON_PROPERTY_MORE_LINK_I_DS,
  Campaign.JSON_PROPERTY_DISCOUNT_OFFER_I_DS
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0")
public class Campaign {
  public static final String JSON_PROPERTY_THE_LINK_I_D = "theLinkID";
  @Deprecated
  private JsonNullable theLinkID = JsonNullable.undefined();

  public static final String JSON_PROPERTY_MORE_LINK_I_DS = "moreLinkIDs";
  @Deprecated
  private List moreLinkIDs = new ArrayList<>();

  public static final String JSON_PROPERTY_DISCOUNT_OFFER_I_DS = "discountOfferIDs";
  @Deprecated
  private JsonNullable> discountOfferIDs = JsonNullable.>undefined();

  public Campaign() { 
  }

  @Deprecated
  public Campaign theLinkID(Long theLinkID) {
    this.theLinkID = JsonNullable.of(theLinkID);
    return this;
  }

  /**
   * Get theLinkID
   * @return theLinkID
   * @deprecated
   */
  @Deprecated
  @javax.annotation.Nullable
  @JsonIgnore

  public Long getTheLinkID() {
        return theLinkID.orElse(null);
  }

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

  public JsonNullable getTheLinkID_JsonNullable() {
    return theLinkID;
  }
  
  @JsonProperty(JSON_PROPERTY_THE_LINK_I_D)
  public void setTheLinkID_JsonNullable(JsonNullable theLinkID) {
    this.theLinkID = theLinkID;
  }

  @Deprecated
  public void setTheLinkID(Long theLinkID) {
    this.theLinkID = JsonNullable.of(theLinkID);
  }


  @Deprecated
  public Campaign moreLinkIDs(List moreLinkIDs) {
    this.moreLinkIDs = moreLinkIDs;
    return this;
  }

  public Campaign addMoreLinkIDsItem(Long moreLinkIDsItem) {
    if (this.moreLinkIDs == null) {
      this.moreLinkIDs = new ArrayList<>();
    }
    this.moreLinkIDs.add(moreLinkIDsItem);
    return this;
  }

  /**
   *  <br><br> Deprecated: No good any more (since: 1.2, removed with: 3.0) 
   * @return moreLinkIDs
   * @deprecated
   */
  @Deprecated
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_MORE_LINK_I_DS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public List getMoreLinkIDs() {
    return moreLinkIDs;
  }


  @Deprecated
  @JsonProperty(JSON_PROPERTY_MORE_LINK_I_DS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setMoreLinkIDs(List moreLinkIDs) {
    this.moreLinkIDs = moreLinkIDs;
  }


  @Deprecated
  public Campaign discountOfferIDs(List discountOfferIDs) {
    this.discountOfferIDs = JsonNullable.>of(discountOfferIDs);
    return this;
  }

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

  /**
   * Get discountOfferIDs
   * @return discountOfferIDs
   * @deprecated
   */
  @Deprecated
  @javax.annotation.Nullable
  @JsonIgnore

  public List getDiscountOfferIDs() {
        return discountOfferIDs.orElse(null);
  }

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

  public JsonNullable> getDiscountOfferIDs_JsonNullable() {
    return discountOfferIDs;
  }
  
  @JsonProperty(JSON_PROPERTY_DISCOUNT_OFFER_I_DS)
  public void setDiscountOfferIDs_JsonNullable(JsonNullable> discountOfferIDs) {
    this.discountOfferIDs = discountOfferIDs;
  }

  @Deprecated
  public void setDiscountOfferIDs(List discountOfferIDs) {
    this.discountOfferIDs = JsonNullable.>of(discountOfferIDs);
  }


  /**
   * Return true if this Campaign object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Campaign campaign = (Campaign) o;
    return equalsNullable(this.theLinkID, campaign.theLinkID) &&
        Objects.equals(this.moreLinkIDs, campaign.moreLinkIDs) &&
        equalsNullable(this.discountOfferIDs, campaign.discountOfferIDs);
  }

  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(hashCodeNullable(theLinkID), moreLinkIDs, hashCodeNullable(discountOfferIDs));
  }

  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 Campaign {\n");
    sb.append("    theLinkID: ").append(toIndentedString(theLinkID)).append("\n");
    sb.append("    moreLinkIDs: ").append(toIndentedString(moreLinkIDs)).append("\n");
    sb.append("    discountOfferIDs: ").append(toIndentedString(discountOfferIDs)).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