PageRenderTime 19ms CodeModel.GetById 13ms app.highlight 5ms RepoModel.GetById 0ms app.codeStats 0ms

/src/com/kousenit/beans/Book.java

http://github.com/kousen/recommended-books
Java | 103 lines | 79 code | 23 blank | 1 comment | 0 complexity | da7a95956988a933f64988f125b5aa10 MD5 | raw file
  1package com.kousenit.beans;
  2
  3import java.io.Serializable;
  4
  5import javax.jdo.annotations.IdGeneratorStrategy;
  6import javax.jdo.annotations.IdentityType;
  7import javax.jdo.annotations.PersistenceCapable;
  8import javax.jdo.annotations.Persistent;
  9import javax.jdo.annotations.PrimaryKey;
 10
 11@PersistenceCapable(identityType = IdentityType.APPLICATION)
 12public class Book implements Serializable {
 13	
 14	private static final long serialVersionUID = 2224649533817426805L;
 15
 16	@PrimaryKey
 17    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
 18	private Long id;
 19	
 20	@Persistent
 21	private String asin;
 22	
 23	@Persistent
 24	private String recommendation;
 25	
 26	// Attributes populated by XML response
 27	private String title;
 28	private String author;  // multiple are separated by commas
 29	private String formattedPrice;
 30	private String mediumImageURL;
 31	private String detailPageURL;
 32	
 33	public Book() {}
 34	
 35	public Book(String asin, String recommendation) {
 36		this.asin = asin;
 37		this.recommendation = recommendation;
 38	}
 39	
 40	public Long getId() {
 41		return id;
 42	}
 43
 44	public String getAsin() {
 45		return asin;
 46	}
 47	public void setAsin(String asin) {
 48		this.asin = asin;
 49	}
 50	public String getRecommendation() {
 51		return recommendation;
 52	}
 53	public void setRecommendation(String recommendation) {
 54		this.recommendation = recommendation;
 55	}
 56		
 57	public String getTitle() {
 58		return title;
 59	}
 60
 61	public void setTitle(String title) {
 62		this.title = title;
 63	}
 64
 65	public String getAuthor() {
 66		return author;
 67	}
 68
 69	public void setAuthor(String author) {
 70		this.author = author;
 71	}
 72
 73	public String getFormattedPrice() {
 74		return formattedPrice;
 75	}
 76
 77	public void setFormattedPrice(String formattedPrice) {
 78		this.formattedPrice = formattedPrice;
 79	}
 80	
 81	public void setMediumImageURL(String mediumImageURL) {
 82		this.mediumImageURL = mediumImageURL;
 83	}
 84	
 85	public String getMediumImageURL() {
 86		return mediumImageURL;
 87	}
 88	
 89	public void setDetailPageURL(String detailPageURL) {
 90		this.detailPageURL = detailPageURL;
 91	}
 92	
 93	public String getDetailPageURL() {
 94		return detailPageURL;
 95	}
 96
 97	@Override
 98	public String toString() {
 99		return "(" + id + "," + asin + "," + 
100			title + "," + author + "," + 
101			formattedPrice + "," + recommendation + ")";
102	}
103}