| 1 | |
package org.jtheque.films.view.impl.fb; |
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
import org.jtheque.core.utils.db.Note; |
| 20 | |
import org.jtheque.films.persistence.od.able.Film; |
| 21 | |
import org.jtheque.films.services.able.IRealizersService; |
| 22 | |
import org.jtheque.primary.od.able.Kind; |
| 23 | |
import org.jtheque.primary.od.able.Language; |
| 24 | |
import org.jtheque.primary.od.able.Person; |
| 25 | |
import org.jtheque.primary.od.able.Saga; |
| 26 | |
import org.jtheque.primary.od.able.Type; |
| 27 | |
|
| 28 | |
import java.util.HashSet; |
| 29 | |
import java.util.Set; |
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | 0 | public final class FilmFormBean implements IFilmFormBean { |
| 38 | |
private String title; |
| 39 | |
private Type type; |
| 40 | |
private Person realizer; |
| 41 | |
private Language language; |
| 42 | |
private Saga saga; |
| 43 | |
private int year; |
| 44 | |
private int duration; |
| 45 | |
private Note note; |
| 46 | |
private String resume; |
| 47 | |
private String comment; |
| 48 | |
private String filePath; |
| 49 | 0 | private Set<Person> actors = new HashSet<Person>(15); |
| 50 | 0 | private Set<Kind> kinds = new HashSet<Kind>(5); |
| 51 | |
|
| 52 | |
@Override |
| 53 | |
public void setTitle(String title) { |
| 54 | 0 | this.title = title; |
| 55 | 0 | } |
| 56 | |
|
| 57 | |
@Override |
| 58 | |
public void setType(Type type) { |
| 59 | 0 | this.type = type; |
| 60 | 0 | } |
| 61 | |
|
| 62 | |
@Override |
| 63 | |
public void setYear(int year) { |
| 64 | 0 | this.year = year; |
| 65 | 0 | } |
| 66 | |
|
| 67 | |
@Override |
| 68 | |
public void setDuration(int duration) { |
| 69 | 0 | this.duration = duration; |
| 70 | 0 | } |
| 71 | |
|
| 72 | |
@Override |
| 73 | |
public void setRealizer(Person realizer) { |
| 74 | 0 | assert realizer.getType().equals(IRealizersService.PERSON_TYPE) : "The person must be of type Realizer"; |
| 75 | |
|
| 76 | 0 | this.realizer = realizer; |
| 77 | 0 | } |
| 78 | |
|
| 79 | |
@Override |
| 80 | |
public void setLanguage(Language language) { |
| 81 | 0 | this.language = language; |
| 82 | 0 | } |
| 83 | |
|
| 84 | |
@Override |
| 85 | |
public void setNote(Note note) { |
| 86 | 0 | this.note = note; |
| 87 | 0 | } |
| 88 | |
|
| 89 | |
@Override |
| 90 | |
public void setComment(String comment) { |
| 91 | 0 | this.comment = comment; |
| 92 | 0 | } |
| 93 | |
|
| 94 | |
@Override |
| 95 | |
public void setResume(String resume) { |
| 96 | 0 | this.resume = resume; |
| 97 | 0 | } |
| 98 | |
|
| 99 | |
@Override |
| 100 | |
public void setActors(Set<Person> actors) { |
| 101 | 0 | this.actors = new HashSet<Person>(actors); |
| 102 | 0 | } |
| 103 | |
|
| 104 | |
@Override |
| 105 | |
public void setSaga(Saga saga) { |
| 106 | 0 | this.saga = saga; |
| 107 | 0 | } |
| 108 | |
|
| 109 | |
@Override |
| 110 | |
public void setFilePath(String filePath) { |
| 111 | 0 | this.filePath = filePath; |
| 112 | 0 | } |
| 113 | |
|
| 114 | |
@Override |
| 115 | |
public void setKinds(Set<Kind> kinds) { |
| 116 | 0 | this.kinds = new HashSet<Kind>(kinds); |
| 117 | 0 | } |
| 118 | |
|
| 119 | |
@Override |
| 120 | |
public void fillFilm(Film film) { |
| 121 | 0 | film.setTitle(title); |
| 122 | 0 | film.addKinds(kinds); |
| 123 | 0 | film.setTheType(type); |
| 124 | 0 | film.setComment(comment); |
| 125 | 0 | film.setNote(note); |
| 126 | 0 | film.addActors(actors); |
| 127 | 0 | film.setTheRealizer(realizer); |
| 128 | 0 | film.setTheLanguage(language); |
| 129 | 0 | film.setYear(year); |
| 130 | 0 | film.setDuration(duration); |
| 131 | 0 | film.setResume(resume); |
| 132 | 0 | film.setFilePath(filePath); |
| 133 | 0 | film.setTheSaga(saga); |
| 134 | 0 | } |
| 135 | |
} |