View Javadoc
1   /******************************************************************************
2    * RestVideo.java - Client facing domain object
3    * $Id: RestVideo.java,v 1.5 2015/05/08 02:37:14 dick Exp $
4    * 
5    * BuckoVidLib - The BuckoSoft Video Library
6    * Copyright(c) 2014 - Dick Balaska
7    * 
8    * $Log: RestVideo.java,v $
9    * Revision 1.5  2015/05/08 02:37:14  dick
10   * findVideosAndThings(key, max) returns videos, actors, directors, and writers
11   *
12   * Revision 1.4  2015/04/27 14:58:15  dick
13   * Use a base 36 string for the REST video key.
14   *
15   * Revision 1.3  2014/10/25 22:49:49  dick
16   * Add the year.
17   *
18   * Revision 1.2  2014/10/09 08:34:35  dick
19   * Use the Video as a key for the client, not just the image url.
20   *
21   * Revision 1.1  2014/10/08 04:34:48  dick
22   * Client facing Video domain object.
23   *
24   */
25  package com.buckosoft.BuckoVidLib.domain.rest;
26  
27  import javax.xml.bind.annotation.XmlRootElement;
28  
29  /** Client facing Video domain object. Lighter weight than the full {@link com.buckosoft.BuckoVidLib.domain.Video}
30   * <p>
31   * Bonus feature! The find list can return things other than a video. So we overload this loose coupled object with other types.
32   * The stype attribute defines what type of overloading.
33   * <ul>
34   * <li> 0 - A video
35   * <li> 1 - A marker - like noting that the following items are "Actor". Markers are not clickable.
36   * <li> 2 - Actor - The title is the name of an actor to re-search on.
37   * <li> 3 - Director - The title is the name of a director to re-search on.
38   * <li> 4 - Writer - The title is the name of a director to re-search on.
39   * <li> 5 - Genre - The title is the name of a director to re-search on.
40   * </ul>
41   * @author dick
42   * @since 2014-10-07
43   */
44  @XmlRootElement(name="Video")
45  public class RestVideo {
46  	
47  	public final static int STYPE_VIDEO		= 0;
48  	public final static int STYPE_MARKER	= 1;
49  	public final static int STYPE_ACTOR		= 2;
50  	public final static int STYPE_DIRECTOR	= 3;
51  	public final static int STYPE_WRITER	= 4;
52  	public final static int STYPE_GENRE		= 5;
53  
54  	private String	title;
55  	private	int		year;
56  	private	String	hashKey;
57  	private	int		stype = 0;
58  	private	int		addedAt;
59  	
60  	/** bean constructor */
61  	public RestVideo() {}
62  	
63  	public RestVideo(String name, int stype) {
64  		this.title = name;
65  		this.stype = stype;
66  	}
67  	
68  	public RestVideo(String name, int stype, int hashKey) {
69  		this.title = name;
70  		this.stype = stype;
71  		this.hashKey = "" + hashKey;
72  	}
73  
74  	/**
75  	 * @return the stype
76  	 */
77  	public int getStype() {
78  		return stype;
79  	}
80  	/**
81  	 * @param stype the stype to set
82  	 */
83  	public void setStype(int stype) {
84  		this.stype = stype;
85  	}
86  	
87  	/**
88  	 * @return the title
89  	 */
90  	public String getTitle() {
91  		return title;
92  	}
93  	/**
94  	 * @param title the title to set
95  	 */
96  	public void setTitle(String title) {
97  		this.title = title;
98  	}
99  
100 	/**
101 	 * @return the year
102 	 */
103 	public int getYear() {
104 		return year;
105 	}
106 	/**
107 	 * @param year the year to set
108 	 */
109 	public void setYear(int year) {
110 		this.year = year;
111 	}
112 	/**
113 	 * @return the hashKey
114 	 */
115 	public String getHashKey() {
116 		return hashKey;
117 	}
118 	/**
119 	 * @param hashKey the hashKey to set
120 	 */
121 	public void setHashKey(String hashKey) {
122 		this.hashKey = hashKey;
123 	}
124 
125 	/**
126 	 * @return the addedAt
127 	 */
128 	public int getAddedAt() {
129 		return addedAt;
130 	}
131 
132 	/**
133 	 * @param addedAt the addedAt to set
134 	 */
135 	public void setAddedAt(int addedAt) {
136 		this.addedAt = addedAt;
137 	}
138 	
139 }