openapitools.model.DiscountOffer Maven / Gradle / Ivy
/*
* 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;
/**
* DiscountOffer
*/
@JsonPropertyOrder({
DiscountOffer.JSON_PROPERTY_CAMPAIGN_I_DS
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0")
public class DiscountOffer {
public static final String JSON_PROPERTY_CAMPAIGN_I_DS = "campaignIDs";
@Deprecated
private JsonNullable> campaignIDs = JsonNullable.>undefined();
public DiscountOffer() {
}
@Deprecated
public DiscountOffer campaignIDs(List campaignIDs) {
this.campaignIDs = JsonNullable.>of(campaignIDs);
return this;
}
public DiscountOffer addCampaignIDsItem(String campaignIDsItem) {
if (this.campaignIDs == null || !this.campaignIDs.isPresent()) {
this.campaignIDs = JsonNullable.>of(new ArrayList<>());
}
try {
this.campaignIDs.get().add(campaignIDsItem);
} catch (java.util.NoSuchElementException e) {
// this can never happen, as we make sure above that the value is present
}
return this;
}
/**
* Get campaignIDs
* @return campaignIDs
* @deprecated
*/
@Deprecated
@javax.annotation.Nullable
@JsonIgnore
public List getCampaignIDs() {
return campaignIDs.orElse(null);
}
@JsonProperty(JSON_PROPERTY_CAMPAIGN_I_DS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable> getCampaignIDs_JsonNullable() {
return campaignIDs;
}
@JsonProperty(JSON_PROPERTY_CAMPAIGN_I_DS)
public void setCampaignIDs_JsonNullable(JsonNullable> campaignIDs) {
this.campaignIDs = campaignIDs;
}
@Deprecated
public void setCampaignIDs(List campaignIDs) {
this.campaignIDs = JsonNullable.>of(campaignIDs);
}
/**
* Return true if this DiscountOffer object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DiscountOffer discountOffer = (DiscountOffer) o;
return equalsNullable(this.campaignIDs, discountOffer.campaignIDs);
}
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(campaignIDs));
}
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 DiscountOffer {\n");
sb.append(" campaignIDs: ").append(toIndentedString(campaignIDs)).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 - 2025 Weber Informatics LLC | Privacy Policy