View Javadoc
1 // $Header: /cvsroot/daoexamples/daoexamples/src/java/daoexamples/movie/MovieImpl.java,v 1.2 2003/08/13 04:04:23 sullis Exp $ 2 3 /* 4 * 5 * 6 * 7 * 8 */ 9 10 package daoexamples.movie; 11 12 /*** 13 * 14 * @author Sean C. Sullivan 15 * 16 * @see MovieDAO 17 * 18 */ 19 class MovieImpl implements Movie 20 { 21 private final String m_id; 22 private final String m_rating; 23 private final String m_year; 24 private final String m_title; 25 26 public MovieImpl(final String id, 27 final String rating, 28 final String year, 29 final String title) 30 { 31 if (id == null) 32 { 33 throw new NullPointerException("id parameter"); 34 } 35 else if (id.length() < 1) 36 { 37 throw new IllegalArgumentException( 38 "id parameter, value = " 39 + id); 40 } 41 42 if (rating == null) 43 { 44 throw new NullPointerException("rating parameter"); 45 } 46 47 if (year == null) 48 { 49 throw new NullPointerException("year parameter"); 50 } 51 if (title == null) 52 { 53 throw new NullPointerException("title parameter"); 54 } 55 56 m_id = id; 57 m_rating = rating; 58 m_year = year; 59 m_title = title; 60 } 61 62 public String getId() 63 { 64 return m_id; 65 } 66 67 public String getRating() 68 { 69 return m_rating; 70 } 71 72 public String getReleaseYear() 73 { 74 return m_year; 75 } 76 77 public String getTitle() 78 { 79 return m_title; 80 } 81 82 public String toString() 83 { 84 StringBuffer sbResult = new StringBuffer(); 85 sbResult.append("id = "); 86 sbResult.append(m_id); 87 sbResult.append(", title = "); 88 sbResult.append(m_title); 89 sbResult.append(", rating = "); 90 sbResult.append(m_rating); 91 sbResult.append(", year = "); 92 sbResult.append(m_year); 93 return sbResult.toString(); 94 } 95 }

This page was automatically generated by Maven