generated.swagger.io.petstore.Pet Maven / Gradle / Ivy
The newest version!
package generated.swagger.io.petstore;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import generated.swagger.io.petstore.TypeEnum;
import java.time.OffsetDateTime;
import jakarta.validation.constraints.NotNull;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
import jakarta.annotation.Generated;
/**
* Pet
*/
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-09-26T07:50:01.463591312Z[Etc/UTC]", comments = "Generator version: 7.8.0")
public class Pet {
private Long id;
private Float price;
private TypeEnum type;
public Pet() {
super();
}
/**
* Constructor with only required parameters
*/
public Pet(Long id, Float price) {
this.id = id;
this.price = price;
}
public Pet id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
*/
@NotNull
@Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("id")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Pet price(Float price) {
this.price = price;
return this;
}
/**
* Get price
* @return price
*/
@NotNull
@Schema(name = "price", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("price")
public Float getPrice() {
return price;
}
public void setPrice(Float price) {
this.price = price;
}
public Pet type(TypeEnum type) {
this.type = type;
return this;
}
/**
* Get type
* @return type
*/
@Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("type")
public TypeEnum getType() {
return type;
}
public void setType(TypeEnum type) {
this.type = type;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Pet pet = (Pet) o;
return Objects.equals(this.id, pet.id) &&
Objects.equals(this.price, pet.price) &&
Objects.equals(this.type, pet.type);
}
@Override
public int hashCode() {
return Objects.hash(id, price, type);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Pet {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" price: ").append(toIndentedString(price)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).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 ");
}
}