package io.delphiplatform.api.v3.model;

import com.fasterxml.jackson.annotation.JsonProperty;

import org.openapitools.jackson.nullable.JsonNullable;

import java.net.URI;
import java.util.Objects;

import javax.validation.Valid;

/**
 * Very basic image container populated with a URI from Atlas (Core)
 */
public class ImageSimple {

    @JsonProperty("uri")
    private URI uri;

    @JsonProperty("height")
    private Integer height;

    @JsonProperty("width")
    private Integer width;

    public ImageSimple uri(URI uri) {
        this.uri = uri;
        return this;
    }

    /**
     * The direct full URI location of an image.
     *
     * @return uri
     */
    @Valid
    public URI getUri() {
        return uri;
    }

    public void setUri(URI uri) {
        this.uri = uri;
    }

    public ImageSimple height(Integer height) {
        this.height = height;
        return this;
    }

    /**
     * Height of the Image in pixels
     *
     * @return height
     */
    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    public ImageSimple width(Integer width) {
        this.width = width;
        return this;
    }

    /**
     * Width of the Image in pixels
     *
     * @return width
     */
    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ImageSimple imageSimple = (ImageSimple) o;
        return Objects.equals(this.uri, imageSimple.uri) &&
            Objects.equals(this.height, imageSimple.height) &&
            Objects.equals(this.width, imageSimple.width);
    }

    @Override
    public int hashCode() {
        return Objects.hash(uri, height, width);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ImageSimple {\n");

        sb.append("    uri: ").append(toIndentedString(uri)).append("\n");
        sb.append("    height: ").append(toIndentedString(height)).append("\n");
        sb.append("    width: ").append(toIndentedString(width)).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    ");
    }
}
