com.criteo.marketing.model.ShippingSize Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of marketing.java-client Show documentation
Show all versions of marketing.java-client Show documentation
Criteo Marketing SDK for Java
/*
* Marketing API v.1.0
* IMPORTANT: This swagger links to Criteo production environment. Any test applied here will thus impact real campaigns.
*
* The version of the OpenAPI document: v.1.0
*
*
* 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.criteo.marketing.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* ShippingSize
*/
public class ShippingSize {
/**
* Gets or Sets unit
*/
@JsonAdapter(UnitEnum.Adapter.class)
public enum UnitEnum {
CM("Cm"),
IN("In");
private String value;
UnitEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static UnitEnum fromValue(String value) {
for (UnitEnum b : UnitEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final UnitEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public UnitEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return UnitEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_UNIT = "unit";
@SerializedName(SERIALIZED_NAME_UNIT)
private UnitEnum unit;
public static final String SERIALIZED_NAME_VALUE = "value";
@SerializedName(SERIALIZED_NAME_VALUE)
private Double value;
public ShippingSize unit(UnitEnum unit) {
this.unit = unit;
return this;
}
/**
* Get unit
* @return unit
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UnitEnum getUnit() {
return unit;
}
public void setUnit(UnitEnum unit) {
this.unit = unit;
}
public ShippingSize value(Double value) {
this.value = value;
return this;
}
/**
* Get value
* @return value
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Double getValue() {
return value;
}
public void setValue(Double value) {
this.value = value;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ShippingSize shippingSize = (ShippingSize) o;
return Objects.equals(this.unit, shippingSize.unit) &&
Objects.equals(this.value, shippingSize.value);
}
@Override
public int hashCode() {
return Objects.hash(unit, value);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ShippingSize {\n");
sb.append(" unit: ").append(toIndentedString(unit)).append("\n");
sb.append(" value: ").append(toIndentedString(value)).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(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy