package com.artisanalapps;

public class Record {
	
    private long id;
	private String artist;
	private String title;
	private String label;
	private String catalog;
	private String year;
	private int condition;
	
	public Record(long id, String artist, String title, String label, String catalog, String year, int condition) {
		this.setId(id);
		this.setArtist(artist);
		this.setTitle(title);
		this.setLabel(label);
		this.setCatalog(catalog);
		this.setYear(year);
		this.setCondition(condition);
	}
	
	public long getId(){
		return id;
	}
	
	public void setId(long id){
		this.id = id;
	}
	
	public String getArtist() {
		return artist;
	}
	
	public void setArtist(String artist) {
		this.artist = artist;
	}
	
	public String getTitle() {
		return title;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getLabel() {
		return label;
	}
	
	public void setLabel(String label) {
		this.label = label;
	}
	
	public String getCatalog() {
		return catalog;
	}
	
	public void setCatalog(String catalog) {
		this.catalog = catalog;
	}
	
	public String getYear() {
		return year;
	}
	
	public void setYear(String year) {
		this.year = year;
	}

	public int getCondition() {
		return condition;
	}
	
	public void setCondition(int condition) {
		this.condition = condition;
	}
	
	public String conditionToString(){
		String cond = "unspecified";
		
		// determine condition (F, G, VG, VG+, M-, M)
		switch (condition) {
		case 0:	cond = "M";
				break;
		case 1:	cond = "M-";
				break;
		case 2:	cond = "VG+";
				break;
		case 3:	cond = "VG";
				break;
		case 4:	cond = "G";
				break;
		case 5:	cond = "F";
				break;
		default:  
			    cond = "N/A";
				break;
		}
		return cond;
	}
	
	public String toString() {
		
		return artist + "\n" + title + "\n" 
					+ label + "\n" + catalog + "\n" + year + "\n"
					+ "CONDITION: " + this.conditionToString();
	}
	
}
