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

org.swaggertools.demo.model.Pet Maven / Gradle / Ivy

There is a newer version: 0.5.6
Show newest version
package org.swaggertools.demo.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import java.lang.Boolean;
import java.lang.Double;
import java.lang.Long;
import java.lang.String;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@JsonTypeInfo(
        use = JsonTypeInfo.Id.NAME,
        property = "_type",
        visible = false
)
@JsonSubTypes({
        @JsonSubTypes.Type(value = Cat.class, name = "Cat"),
        @JsonSubTypes.Type(value = Dog.class, name = "Dog")
})
public class Pet {
    @JsonProperty("id")
    @NotNull
    private Long id = 0L;

    @JsonProperty("name")
    @NotNull
    @Size(
            min = 3
    )
    private String name = "noname";

    @JsonProperty("available")
    private Boolean available = true;

    @JsonProperty("price")
    @Min(0)
    private Double price;

    @JsonProperty("uid")
    private UUID uid;

    @JsonProperty("createTime")
    private OffsetDateTime createTime;

    @JsonProperty("owner")
    @Valid
    private Owner owner;

    @JsonProperty("color")
    @Valid
    private Color color;

    @JsonProperty("details")
    @Valid
    private Map details = new HashMap();

    @JsonProperty("thumbnail")
    private byte[] thumbnail;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean isAvailable() {
        return available;
    }

    public void setAvailable(Boolean available) {
        this.available = available;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public UUID getUid() {
        return uid;
    }

    public void setUid(UUID uid) {
        this.uid = uid;
    }

    public OffsetDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(OffsetDateTime createTime) {
        this.createTime = createTime;
    }

    public Owner getOwner() {
        return owner;
    }

    public void setOwner(Owner owner) {
        this.owner = owner;
    }

    public Color getColor() {
        return color;
    }

    public void setColor(Color color) {
        this.color = color;
    }

    public Map getDetails() {
        return details;
    }

    public void setDetails(Map details) {
        this.details = details;
    }

    public byte[] getThumbnail() {
        return thumbnail;
    }

    public void setThumbnail(byte[] thumbnail) {
        this.thumbnail = thumbnail;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy