package io.delphiplatform.api.v3.model.trackposition;

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

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

import javax.validation.Valid;

/**
 * PlaylistTrackPositionAdditions response container
 */
@Deprecated
@JsonPropertyOrder(alphabetic = true)
public class PlaylistTrackPositionAdditions {

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

    @JsonProperty("count")
    private Integer count;

    @JsonProperty("next_cursor")
    private String nextCursor;

    public PlaylistTrackPositionAdditions items(List<PlaylistTrackPositionAddition> items) {
        this.items = items;
        return this;
    }

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

    /**
     * Get items
     *
     * @return items
     */
    @Valid
    public List<PlaylistTrackPositionAddition> getItems() {
        return items;
    }

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

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

    /**
     * The number of `items` returned in the response
     *
     * @return count
     */
    public Integer getCount() {
        return count;
    }

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

    public PlaylistTrackPositionAdditions nextCursor(String nextCursor) {
        this.nextCursor = nextCursor;
        return this;
    }

    public String getNextCursor() {
        return nextCursor;
    }

    public void setNextCursor(String nextCursor) {
        this.nextCursor = nextCursor;
    }

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

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

    @Override
    public String toString() {
        return "class PlaylistTrackPositionAdditions {\n"
            + "    items: " + toIndentedString(items) + "\n"
            + "    count: " + toIndentedString(count) + "\n"
            + "    nextCursor: " + toIndentedString(nextCursor) + "\n"
            + "}";
    }

    /**
     * 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    ");
    }
}

