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;

/**
 * ArtistAllOf
 */
public class ArtistAllOf {

    @JsonProperty("products")
    @Valid
    private List<ProductSimple> products = null;

    @JsonProperty("tracks")
    @Valid
    private List<TrackSimple> tracks = null;

    public ArtistAllOf products(List<ProductSimple> products) {
        this.products = products;
        return this;
    }

    public ArtistAllOf addProductsItem(ProductSimple productsItem) {
        if (this.products == null) {
            this.products = new ArrayList<>();
        }
        this.products.add(productsItem);
        return this;
    }

    /**
     * Get products
     *
     * @return products
     */
    @Valid
    public List<ProductSimple> getProducts() {
        return products;
    }

    public void setProducts(List<ProductSimple> products) {
        this.products = products;
    }

    public ArtistAllOf tracks(List<TrackSimple> tracks) {
        this.tracks = tracks;
        return this;
    }

    public ArtistAllOf addTracksItem(TrackSimple tracksItem) {
        if (this.tracks == null) {
            this.tracks = new ArrayList<>();
        }
        this.tracks.add(tracksItem);
        return this;
    }

    /**
     * Get tracks
     *
     * @return tracks
     */
    @Valid
    public List<TrackSimple> getTracks() {
        return tracks;
    }

    public void setTracks(List<TrackSimple> tracks) {
        this.tracks = tracks;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ArtistAllOf artistAllOf = (ArtistAllOf) o;
        return Objects.equals(this.products, artistAllOf.products) &&
            Objects.equals(this.tracks, artistAllOf.tracks);
    }

    @Override
    public int hashCode() {
        return Objects.hash(products, tracks);
    }

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

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