-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMovieUtil.java
More file actions
182 lines (146 loc) · 5.7 KB
/
MovieUtil.java
File metadata and controls
182 lines (146 loc) · 5.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
package movieexample;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
public class MovieUtil {
private static List<Movie> movies = new ArrayList<>();
public static List<Movie> getMovieData() {
// casino royale, Rating 4
Movie casinoRoyale = new Movie("Casino Royale", "Martin Campbell");
List<String> starCast = new ArrayList<>();
starCast.add("Daniel Craig");
starCast.add("Eva Green");
casinoRoyale.setCast(starCast);
casinoRoyale.setGenre(Genre.ACTION);
casinoRoyale.setRating(4);
casinoRoyale.setDateOfRelease(LocalDate.of(2006, 11, 14));
casinoRoyale.setGrossEarning(606_099_584);
// Avengers, Rating 5
Movie avengers = new Movie("Avengers:Endgame", "Anthony Russo");
List<String> avengersStarCast = new ArrayList<>();
avengersStarCast.add("Robert Downey Jr.");
avengersStarCast.add("Chris Evans");
avengersStarCast.add("Mark Ruffalo");
avengersStarCast.add("Chris Hemsworth");
avengers.setCast(avengersStarCast);
avengers.setGenre(Genre.SUPERHERO);
avengers.setRating(5);
avengers.setDateOfRelease(LocalDate.of(2019, 04, 26));
avengers.setGrossEarning(3_000_000_000L);
// Johnny English, Rating 4
Movie johnyEnglish = new Movie("Johnny English", "Peter Howitt");
List<String> johnyEnglishStarCast = new ArrayList<>();
johnyEnglishStarCast.add("Rowan Atkinson");
johnyEnglish.setCast(johnyEnglishStarCast);
johnyEnglish.setGenre(Genre.COMEDY);
johnyEnglish.setRating(4);
johnyEnglish.setDateOfRelease(LocalDate.of(2003, 04, 11));
johnyEnglish.setGrossEarning(159_000_000);
// The Departed, Rating 5
Movie departed = new Movie("The Departed", "Martin Scorsese");
List<String> departedStarCast = new ArrayList<>();
departedStarCast.add("Leonardo DiCaprio");
departedStarCast.add("Matt Damon");
departedStarCast.add("Jack Nicholson");
departed.setCast(departedStarCast);
departed.setGenre(Genre.CRIME);
departed.setRating(5);
departed.setDateOfRelease(LocalDate.of(2006, 9, 26));
departed.setGrossEarning(291_000_000);
// The grudge, Rating 3
Movie grudge = new Movie("The Grudge", "Nicolas Pesce");
List<String> grudgeStarCast = new ArrayList<>();
grudgeStarCast.add("John Cho");
grudgeStarCast.add("Andrea Riseborough");
grudge.setCast(grudgeStarCast);
grudge.setGenre(Genre.HORROR);
grudge.setRating(3);
grudge.setDateOfRelease(LocalDate.of(2020, 1, 3));
grudge.setGrossEarning(50_000_000);
// The wolf of wall street, Rating 5
Movie wows = new Movie("The Wolf Of Wall Street", "Martin Scorsese");
List<String> wowfStarCast = new ArrayList<>();
wowfStarCast.add("Leonardo DiCaprio");
wowfStarCast.add("Jonah Hill");
wowfStarCast.add("Margot Robbie");
wows.setCast(wowfStarCast);
wows.setGenre(Genre.CRIME);
wows.setRating(5);
wows.setDateOfRelease(LocalDate.of(2013, 12, 25));
wows.setGrossEarning(392_000_000);
// Once upon a time in hollywood, Rating 5
Movie onceHollywood = new Movie("Once upon a time in Hollywood", "Quentin Tarantino");
List<String> onceHollyWoodStarCast = new ArrayList<>();
onceHollyWoodStarCast.add("Leonardo DiCaprio");
onceHollyWoodStarCast.add("Brad Pitt");
onceHollyWoodStarCast.add("Margot Robbie");
onceHollywood.setCast(onceHollyWoodStarCast);
onceHollywood.setGenre(Genre.COMEDY);
onceHollywood.setRating(5);
onceHollywood.setDateOfRelease(LocalDate.of(2019, 7, 26));
onceHollywood.setGrossEarning(374_000_000);
// Fight club, Rating 5
Movie fightClub = new Movie("Fight Club", "David Fincher");
List<String> fightClubStarCast = new ArrayList<>();
fightClubStarCast.add("Brad Pitt");
fightClubStarCast.add("Edward Norton");
fightClub.setCast(fightClubStarCast);
fightClub.setGenre(Genre.ACTION);
fightClub.setRating(5);
fightClub.setDateOfRelease(LocalDate.of(1999, 10, 10));
fightClub.setGrossEarning(101_000_000);
// Bad Boys For Life ,Rating 3
Movie badBoys = new Movie("Bad Boys For Life", "Adil El Arbi");
List<String> badBoysStarCast = new ArrayList<>();
badBoysStarCast.add("Will Smith");
badBoysStarCast.add("Martin Lawrence");
badBoys.setCast(badBoysStarCast);
badBoys.setGenre(Genre.ACTION);
badBoys.setRating(3);
badBoys.setDateOfRelease(LocalDate.of(2020, 01, 17));
badBoys.setGrossEarning(291_000_000);
//Rocky two
Movie rockyTwo = new Movie("Rocky Two", "Sylvester Stallone");
List<String> rockyTwoCast = new ArrayList<>();
rockyTwoCast.add("Sylvester Stallone");
rockyTwoCast.add("Carl Weathers");
rockyTwo.setCast(rockyTwoCast);
rockyTwo.setGenre(Genre.ACTION);
rockyTwo.setRating(4);
rockyTwo.setDateOfRelease(LocalDate.of(1979, 06, 15));
rockyTwo.setGrossEarning(200_000_000);
//Rocky
Movie rockyOne = new Movie("Rocky", "John G. Avildsen");
List<String> rockyOneCast = new ArrayList<>();
rockyOneCast.add("Sylvester Stallone");
rockyOneCast.add("Carl Weathers");
rockyOne.setCast(rockyOneCast);
rockyOne.setGenre(Genre.ACTION);
rockyOne.setRating(4);
rockyOne.setDateOfRelease(LocalDate.of(1976, 12, 03));
rockyOne.setGrossEarning(225_000_000);
//Rocky three
Movie rockyThree = new Movie("Rocky Three", "Sylvester Stallone");
List<String> rockyThreeCast = new ArrayList<>();
rockyThreeCast.add("Sylvester Stallone");
rockyThreeCast.add("Carl Weathers");
rockyThree.setCast(rockyThreeCast);
rockyThree.setGenre(Genre.ACTION);
rockyThree.setRating(4);
rockyThree.setDateOfRelease(LocalDate.of(1982, 05, 28));
rockyThree.setGrossEarning(270_000_000);
movies.add(casinoRoyale);
movies.add(avengers);
movies.add(johnyEnglish);
movies.add(departed);
movies.add(grudge);
movies.add(wows);
movies.add(onceHollywood);
movies.add(fightClub);
movies.add(badBoys);
movies.add(rockyTwo);
movies.add(rockyOne);
movies.add(rockyThree);
return movies;
}
}