package io.delphiplatform.api.v3.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * Stream Dates response container
 */
@JsonPropertyOrder(alphabetic = true)
public class StreamDates {

    @JsonProperty("items")
    private List<StreamDate> items = null;

    @JsonProperty("count")
    private Integer count;

    public StreamDates items(List<StreamDate> items) {
        this.items = items;
        return this;
    }

    public StreamDates addItemsItem(StreamDate itemsItem) {
        if (this.items == null) {
            this.items = new ArrayList<>();
        }
        this.items.add(itemsItem);
        return this;
    }

    public List<StreamDate> getItems() {
        return items;
    }

    public void setItems(List<StreamDate> items) {
        this.items = items;
    }

    public StreamDates count(Integer count) {
        this.count = count;
        return this;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        StreamDates streamDates = (StreamDates) o;
        return Objects.equals(this.items, streamDates.items) &&
            Objects.equals(this.count, streamDates.count);
    }

    @Override
    public int hashCode() {
        return Objects.hash(items, count);
    }

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

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

