forked from cuongquangnam/CZ2002-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMovie.java
151 lines (126 loc) · 3.21 KB
/
Movie.java
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
package com.models;
import java.util.*;
public class Movie {
private String movieTitle;
private int showingStatus;
private String sypnosis;
private String director;
private ArrayList <String> cast;
private double basePrice;
// private boolean is3D;
private boolean isBlockBuster;
public Movie()
{
}
public Movie(String movieTitle, int showingStatus, String sypnosis, String director, ArrayList<String> cast,
double basePrice, boolean isBlockBuster) {
super();
this.movieTitle = movieTitle;
this.showingStatus = showingStatus;
this.sypnosis = sypnosis;
this.director = director;
this.cast = cast;
this.basePrice = basePrice;
// this.is3D= is3D;
this.isBlockBuster= isBlockBuster;
}
public double getBasePrice() {
return this.basePrice;
}
public void setBasePrice(double basePrice) {
this.basePrice = basePrice;
}
//Getter and Setter Methods
public String getMovieTitle() {
return movieTitle;
}
public void setMovieTitle(String movieTitle) {
this.movieTitle = movieTitle;
}
public int getShowingStatus() {
return showingStatus;
}
public void setShowingStatus(int showingStatus) {
this.showingStatus = showingStatus;
}
public String getSypnosis() {
return sypnosis;
}
public void setSypnosis(String sypnosis) {
this.sypnosis = sypnosis;
}
public String getDirector() {
return director;
}
public void setDirector(String director) {
this.director = director;
}
public ArrayList<String> getCast() {
return cast;
}
public void setCast(ArrayList<String> cast) {
this.cast = cast;
}
// public boolean isIs3D() {
// return is3D;
// }
//
//
// public void setIs3D(boolean is3d) {
// is3D = is3d;
// }
public boolean isBlockBuster() {
return isBlockBuster;
}
public void setBlockBuster(boolean isBlockBuster) {
this.isBlockBuster = isBlockBuster;
}
//equals and hash code
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((cast == null) ? 0 : cast.hashCode());
result = prime * result + ((director == null) ? 0 : director.hashCode());
result = prime * result + ((movieTitle == null) ? 0 : movieTitle.hashCode());
result = prime * result + ((sypnosis == null) ? 0 : sypnosis.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Movie other = (Movie) obj;
if (cast == null) {
if (other.cast != null)
return false;
} else if (!cast.equals(other.cast))
return false;
if (director == null) {
if (other.director != null)
return false;
} else if (!director.equals(other.director))
return false;
if (movieTitle == null) {
if (other.movieTitle != null)
return false;
} else if (!movieTitle.equals(other.movieTitle))
return false;
if (sypnosis == null) {
if (other.sypnosis != null)
return false;
} else if (!sypnosis.equals(other.sypnosis))
return false;
return true;
}
//to string
@Override
public String toString() {
return "Movie [movieTitle=" + movieTitle + ", showingStatus=" + showingStatus + ", sypnosis=" + sypnosis
+ ", director=" + director + ", cast=" + cast + "]";
}
}