package io.delphiplatform.api.v3.model;

import com.fasterxml.jackson.annotation.JsonProperty;

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

import javax.validation.Valid;

/**
 * TrackAllOf
 */
public class TrackAllOf {

    @JsonProperty("artists")
    @Valid
    private List<ArtistSimple> artists = null;

    public TrackAllOf artists(List<ArtistSimple> artists) {
        this.artists = artists;
        return this;
    }

    public TrackAllOf addArtistsItem(ArtistSimple artistsItem) {
        if (this.artists == null) {
            this.artists = new ArrayList<>();
        }
        this.artists.add(artistsItem);
        return this;
    }

    /**
     * Get artists
     *
     * @return artists
     */
    @Valid
    public List<ArtistSimple> getArtists() {
        return artists;
    }

    public void setArtists(List<ArtistSimple> artists) {
        this.artists = artists;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TrackAllOf trackAllOf = (TrackAllOf) o;
        return Objects.equals(this.artists, trackAllOf.artists);
    }

    @Override
    public int hashCode() {
        return Objects.hash(artists);
    }

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

        sb.append("    artists: ").append(toIndentedString(artists)).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    ");
    }
}
