Movie.java (2803B)
1 package de.nordgedanken.rpicms; 2 3 import java.io.Serializable; 4 import java.net.URI; 5 import java.net.URISyntaxException; 6 7 import android.util.Log; 8 9 public class Movie implements Serializable { 10 static final long serialVersionUID = 727566175075960653L; 11 private static long count = 0; 12 private long id; 13 private String title; 14 private String description; 15 private String bgImageUrl; 16 private String cardImageUrl; 17 private String videoUrl; 18 private String studio; 19 private String category; 20 21 public Movie() { 22 } 23 24 public static long getCount() { 25 return count; 26 } 27 28 public static void incCount() { 29 count++; 30 } 31 32 public long getId() { 33 return id; 34 } 35 36 public void setId(long id) { 37 this.id = id; 38 } 39 40 public String getTitle() { 41 return title; 42 } 43 44 public void setTitle(String title) { 45 this.title = title; 46 } 47 48 public String getDescription() { 49 return description; 50 } 51 52 public void setDescription(String description) { 53 this.description = description; 54 } 55 56 public String getStudio() { 57 return studio; 58 } 59 60 public void setStudio(String studio) { 61 this.studio = studio; 62 } 63 64 public String getVideoUrl() { 65 return videoUrl; 66 } 67 68 public void setVideoUrl(String videoUrl) { 69 this.videoUrl = videoUrl; 70 } 71 72 public String getBackgroundImageUrl() { 73 return bgImageUrl; 74 } 75 76 public void setBackgroundImageUrl(String bgImageUrl) { 77 this.bgImageUrl = bgImageUrl; 78 } 79 80 public String getCardImageUrl() { 81 return cardImageUrl; 82 } 83 84 public void setCardImageUrl(String cardImageUrl) { 85 this.cardImageUrl = cardImageUrl; 86 } 87 88 public String getCategory() { 89 return category; 90 } 91 92 public void setCategory(String category) { 93 this.category = category; 94 } 95 96 public URI getBackgroundImageURI() { 97 try { 98 Log.d("BACK MOVIE: ", bgImageUrl); 99 return new URI(getBackgroundImageUrl()); 100 } catch (URISyntaxException e) { 101 Log.d("URI exception: ", bgImageUrl); 102 return null; 103 } 104 } 105 106 public URI getCardImageURI() { 107 try { 108 return new URI(getCardImageUrl()); 109 } catch (URISyntaxException e) { 110 return null; 111 } 112 } 113 114 @Override 115 public String toString() { 116 return "Movie{" + 117 "id=" + id + 118 ", title='" + title + '\'' + 119 ", videoUrl='" + videoUrl + '\'' + 120 ", backgroundImageUrl='" + bgImageUrl + '\'' + 121 ", backgroundImageURI='" + getBackgroundImageURI().toString() + '\'' + 122 ", cardImageUrl='" + cardImageUrl + '\'' + 123 '}'; 124 } 125 }