-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDVDDaoStubImpl.java
More file actions
75 lines (62 loc) · 1.79 KB
/
DVDDaoStubImpl.java
File metadata and controls
75 lines (62 loc) · 1.79 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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package DVD.dao;
import DVD.dto.DVD;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Kelsey
*/
public class DVDDaoStubImpl implements DVDDao{
DVD onlyDvd;
List<DVD>dvdList=new ArrayList<>();
public DVDDaoStubImpl(){
onlyDvd=new DVD("Game");
onlyDvd.setMpaaRating("R");
onlyDvd.setReleaseDate("2008");
onlyDvd.setDirectorName("Kelsey");
onlyDvd.setStudio("Marvel");
onlyDvd.setUserRating("Good");
dvdList.add(onlyDvd);
}
@Override
public DVD addDVD(String title, DVD dvd) throws DVDDaoFilePersistenceException {
if(title.equals(onlyDvd.getTitle())){
return onlyDvd;
}else{
return null;
}
}
@Override
public List<DVD> getAllDVDS() throws DVDDaoFilePersistenceException {
return dvdList;
}
@Override
public DVD getDVD(String title) throws DVDDaoFilePersistenceException {
if(title.equals(onlyDvd.getTitle())){
return onlyDvd;
}else{
return null;
}
}
@Override
public DVD removeDVD(String title) throws DVDDaoFilePersistenceException {
if(title.equals(onlyDvd.getTitle())){
return onlyDvd;
}else{
return null;
}
}
@Override
public DVD editDVD(String title, DVD newDVD) throws DVDDaoFilePersistenceException {
if(title.equals(onlyDvd.getTitle())){
return onlyDvd;
}else{
return null;
}
}
}