1
2
3
4
5
6
7
8 package com.buckosoft.BuckoVidLib.domain;
9
10 import java.util.ArrayList;
11 import java.util.List;
12
13
14
15
16
17
18
19
20
21 public class LibrarySection {
22 private int key;
23 private String name;
24 private String type;
25 private boolean restricted = false;
26 private List<VideoBase> videos = new ArrayList<VideoBase>();
27
28 public enum Type {
29 Movie,
30 TVShow,
31 }
32
33 public LibrarySection() {}
34
35
36
37
38 public LibrarySection(LibrarySection other) {
39 this.key = other.key;
40 this.name = other.name;
41 this.type = other.type;
42 this.restricted = other.restricted;
43 for (VideoBase vb : other.videos)
44 videos.add(vb);
45 }
46
47
48
49 public int getKey() {
50 return key;
51 }
52
53
54
55 public void setKey(int key) {
56 this.key = key;
57 }
58
59
60
61 public String getName() {
62 return name;
63 }
64
65
66
67 public void setName(String name) {
68 this.name = name;
69 }
70
71
72
73 public int getVideoCount() {
74 return(this.videos.size());
75 }
76
77
78
79
80 public List<VideoBase> getVideos() {
81 return videos;
82 }
83
84
85
86 public void setVideos(List<VideoBase> videos) {
87 this.videos = videos;
88 }
89
90 public void addVideo(VideoBase v) {
91 this.videos.add(v);
92 }
93
94
95
96 public Type getType() {
97 return(type.equals("M") ? Type.Movie : Type.TVShow);
98 }
99
100
101
102 public void setType(Type type) {
103 this.type = type == Type.Movie ? "M" : "T";
104 }
105
106 public void setType(String type) {
107 if (type.equals("movie"))
108 this.type = "M";
109 if (type.equals("show"))
110 this.type = "T";
111 }
112
113
114
115
116 public void setCtype(String type) {
117 this.type = type;
118 }
119 public String getCtype() {
120 return(this.type);
121 }
122
123
124
125
126 public boolean isRestricted() {
127 return restricted;
128 }
129
130
131
132 public void setRestricted(boolean restricted) {
133 this.restricted = restricted;
134 }
135
136 }