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

import java.io.Serializable;
import java.util.Date;

public final class Listing implements Serializable {
    private static final long serialVersionUID = 925186562059541625L;
    private String status;
    private Price price;
    private boolean allow_offers;
    private String sleeve_condition;
    private long id;
    private String condition;
    private Date posted;
    private String ships_from;
    private String uri;
    private String comments;
    private Seller seller;
    private ListingRelease release;
    private String resource_url;
    private boolean audio;

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Price getPrice() {
        return price;
    }

    public void setPrice(Price price) {
        this.price = price;
    }

    public boolean isAllow_offers() {
        return allow_offers;
    }

    public void setAllow_offers(boolean allow_offers) {
        this.allow_offers = allow_offers;
    }

    public String getSleeve_condition() {
        return sleeve_condition;
    }

    public void setSleeve_condition(String sleeve_condition) {
        this.sleeve_condition = sleeve_condition;
    }

    public long getId() {
        return id;
    }

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

    public String getCondition() {
        return condition;
    }

    public void setCondition(String condition) {
        this.condition = condition;
    }

    public Date getPosted() {
        return posted;
    }

    public void setPosted(Date posted) {
        this.posted = posted;
    }

    public String getShips_from() {
        return ships_from;
    }

    public void setShips_from(String ships_from) {
        this.ships_from = ships_from;
    }

    public String getUri() {
        return uri;
    }

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

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public Seller getSeller() {
        return seller;
    }

    public void setSeller(Seller seller) {
        this.seller = seller;
    }

    public ListingRelease getRelease() {
        return release;
    }

    public void setRelease(ListingRelease release) {
        this.release = release;
    }

    public String getResource_url() {
        return resource_url;
    }

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

    public boolean isAudio() {
        return audio;
    }

    public void setAudio(boolean audio) {
        this.audio = audio;
    }

    @Override
    public String toString() {
        return "Listing{" + "status=" + status + ", price=" + price + ", allow_offers=" + allow_offers + ", sleeve_condition=" + sleeve_condition + ", id=" + id + ", condition=" + condition + ", posted=" + posted + ", ships_from=" + ships_from + ", uri=" + uri + ", comments=" + comments + ", seller=" + seller + ", release=" + release + ", resource_url=" + resource_url + ", audio=" + audio + '}';
    }
    
    /** Helpers **/
    public String getPriceString() {
        if (price == null) {
            return "";
        }
        return price.getValue() + " " + price.getCurrency();
    }
    public Double getPriceAmout() {
        if (price == null) {
            return null;
        }
        return price.getValue();
    }
    public String getPriceCurrency() {
        if (price == null) {
            return "";
        }
        return price.getCurrency();
    }
    
}
