Coverage Report - org.jtheque.films.services.impl.utils.file.jt.JTFFile
 
Classes in this File Line Coverage Branch Coverage Complexity
JTFFile
0 %
0/29
0 %
0/6
1.111
 
 1  
 package org.jtheque.films.services.impl.utils.file.jt;
 2  
 
 3  
 /*
 4  
  * This file is part of JTheque.
 5  
  *
 6  
  * JTheque is free software: you can redistribute it and/or modify
 7  
  * it under the terms of the GNU General Public License as published by
 8  
  * the Free Software Foundation, either version 3 of the License.
 9  
  *
 10  
  * JTheque is distributed in the hope that it will be useful,
 11  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  
  * GNU General Public License for more details.
 14  
  *
 15  
  * You should have received a copy of the GNU General Public License
 16  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 17  
  */
 18  
 
 19  
 import org.jtheque.core.utils.file.jt.AbstractJTFileHeader;
 20  
 import org.jtheque.core.utils.file.jt.able.JTNotZippedFile;
 21  
 import org.jtheque.films.persistence.od.able.Film;
 22  
 import org.jtheque.films.services.impl.utils.file.jt.header.JTFFileHeader;
 23  
 import org.jtheque.primary.od.able.Country;
 24  
 import org.jtheque.primary.od.able.Kind;
 25  
 import org.jtheque.primary.od.able.Language;
 26  
 import org.jtheque.primary.od.able.Person;
 27  
 import org.jtheque.primary.od.able.Type;
 28  
 
 29  
 import java.util.ArrayList;
 30  
 import java.util.Collection;
 31  
 import java.util.HashSet;
 32  
 import java.util.Set;
 33  
 
 34  
 /**
 35  
  * A JTF File. It's a file to store all the informations about a file.
 36  
  *
 37  
  * @author Baptiste Wicht
 38  
  */
 39  0
 public final class JTFFile implements JTNotZippedFile {
 40  
     private Film film;
 41  
     private Set<Person> actors;
 42  
     private Set<Kind> kinds;
 43  
     private Person realizer;
 44  
     private Language language;
 45  
     private Type type;
 46  
     private Collection<Country> countries;
 47  
 
 48  0
     private boolean correctSeparators = true;
 49  
 
 50  0
     private final AbstractJTFileHeader header = new JTFFileHeader();
 51  
 
 52  
     @Override
 53  
     public AbstractJTFileHeader getHeader() {
 54  0
         return header;
 55  
     }
 56  
 
 57  
     @Override
 58  
     public boolean isValid() {
 59  0
         return film != null && header.isComplete() && correctSeparators;
 60  
     }
 61  
 
 62  
     @Override
 63  
     public boolean isCorrectSeparators() {
 64  0
         return correctSeparators;
 65  
     }
 66  
 
 67  
     @Override
 68  
     public void setCorrectSeparators(boolean correctSeparators) {
 69  0
         this.correctSeparators = correctSeparators;
 70  0
     }
 71  
 
 72  
     /**
 73  
      * Return the actors of the file.
 74  
      *
 75  
      * @return The actors of the file.
 76  
      */
 77  
     public Iterable<Person> getActors() {
 78  0
         return actors;
 79  
     }
 80  
 
 81  
     /**
 82  
      * Set the actors of the file.
 83  
      *
 84  
      * @param actors The actors of the file.
 85  
      */
 86  
     public void setActors(Set<Person> actors) {
 87  0
         this.actors = new HashSet<Person>(actors);
 88  0
     }
 89  
 
 90  
     /**
 91  
      * Return the kinds of the file.
 92  
      *
 93  
      * @return A list containing all the kinds of the file.
 94  
      */
 95  
     public Iterable<Kind> getKinds() {
 96  0
         return kinds;
 97  
     }
 98  
 
 99  
     /**
 100  
      * Set the kinds of the file.
 101  
      *
 102  
      * @param kinds The kinds of the file.
 103  
      */
 104  
     public void setKinds(Set<Kind> kinds) {
 105  0
         this.kinds = new HashSet<Kind>(kinds);
 106  0
     }
 107  
 
 108  
     /**
 109  
      * Return the film.
 110  
      *
 111  
      * @return The film of the file.
 112  
      */
 113  
     public Film getFilm() {
 114  0
         return film;
 115  
     }
 116  
 
 117  
     /**
 118  
      * Set the film.
 119  
      *
 120  
      * @param film The film.
 121  
      */
 122  
     public void setFilm(Film film) {
 123  0
         this.film = film;
 124  0
     }
 125  
 
 126  
     /**
 127  
      * Return the language.
 128  
      *
 129  
      * @return The language.
 130  
      */
 131  
     public Language getLanguage() {
 132  0
         return language;
 133  
     }
 134  
 
 135  
     /**
 136  
      * Set the language.
 137  
      *
 138  
      * @param language The language.
 139  
      */
 140  
     public void setLanguage(Language language) {
 141  0
         this.language = language;
 142  0
     }
 143  
 
 144  
     /**
 145  
      * Return the countries.
 146  
      *
 147  
      * @return The countries.
 148  
      */
 149  
     public Iterable<Country> getCountries() {
 150  0
         return countries;
 151  
     }
 152  
 
 153  
     /**
 154  
      * Set the countries.
 155  
      *
 156  
      * @param countries The countries.
 157  
      */
 158  
     public void setCountries(Collection<Country> countries) {
 159  0
         this.countries = new ArrayList<Country>(countries);
 160  0
     }
 161  
 
 162  
     /**
 163  
      * Return the realizer.
 164  
      *
 165  
      * @return The realizer.
 166  
      */
 167  
     public Person getRealizer() {
 168  0
         return realizer;
 169  
     }
 170  
 
 171  
     /**
 172  
      * Set the realizer.
 173  
      *
 174  
      * @param realizer The realizer.
 175  
      */
 176  
     public void setRealizer(Person realizer) {
 177  0
         this.realizer = realizer;
 178  0
     }
 179  
 
 180  
     /**
 181  
      * Return the type.
 182  
      *
 183  
      * @return The type.
 184  
      */
 185  
     public Type getType() {
 186  0
         return type;
 187  
     }
 188  
 
 189  
     /**
 190  
      * Set the type.
 191  
      *
 192  
      * @param type The type.
 193  
      */
 194  
     public void setType(Type type) {
 195  0
         this.type = type;
 196  0
     }
 197  
 }