package be.msyben.vinylManager.tools.discogs.entities;

import java.io.Serializable;

public final class SearchResult implements Serializable {
    private static final long serialVersionUID = 5326093094120474402L;
    
    private String[] style;
    private String thumb;
    private String country;
    private String[] format;
    private String uri;
    private Community community;
    private String[] label;
    private String catno;
    private int year;
    private String[] genre;
    private String title;
    private String resource_url;
    private String type;
    private long id;

    public String[] getStyle() {
        return style;
    }

    public void setStyle(String[] style) {
        this.style = style;
    }

    public String getThumb() {
        return thumb;
    }

    public void setThumb(String thumb) {
        this.thumb = thumb;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String[] getFormat() {
        return format;
    }

    public void setFormat(String[] format) {
        this.format = format;
    }

    public String getUri() {
        return uri;
    }

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

    public Community getCommunity() {
        return community;
    }

    public void setCommunity(Community community) {
        this.community = community;
    }

    public String[] getLabel() {
        return label;
    }

    public void setLabel(String[] label) {
        this.label = label;
    }

    public String getCatno() {
        return catno;
    }

    public void setCatno(String catno) {
        this.catno = catno;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public String[] getGenre() {
        return genre;
    }

    public void setGenre(String[] genre) {
        this.genre = genre;
    }

    public String getResource_url() {
        return resource_url;
    }

    public void setResource_url(String resource_url) {
        this.resource_url = resource_url;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    
    
    
    public String getFormatString() {
        StringBuilder sb = new StringBuilder();
        
        if (format != null) {
            boolean first = true;
            for (String f : format) {
                if (!first) {
                    sb.append(", ");
                } else {
                    first = false;
                }
                sb.append(f);
            }
        }
        return sb.toString();
    } 
    
    public String getStyleString() {
        StringBuilder sb = new StringBuilder();
        
        if (style != null) {
            boolean first = true;
            for (String s : style) {
                if (!first) {
                    sb.append(", ");
                    first = false;
                } else {
                    first = false;
                }
                sb.append(s);
            }
        }
        return sb.toString();
    }
       
    public String getGenreString() {
        StringBuilder sb = new StringBuilder();
        
        if (genre != null) {
            boolean first = true;
            for (String g : genre) {
                if (!first) {
                    sb.append(", ");
                } else {
                    first = false;
                }
                sb.append(g);
            }
        }
        return sb.toString();
    }
       
    public String getLabelString() {
        StringBuilder sb = new StringBuilder();
        
        if (label != null) {
            boolean first = true;
            for (String l : label) {
                if (!first) {
                    sb.append(", ");
                } else {
                    first = false;
                }
                sb.append(l);
            }
        }
        return sb.toString();
    }
}
