Coverage Report - org.jtheque.primary.od.impl.CollectionImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
CollectionImpl
0 %
0/17
0 %
0/2
1.2
 
 1  
 package org.jtheque.primary.od.impl;
 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.primary.od.able.Collection;
 20  
 import org.jtheque.primary.od.impl.abstraction.AbstractPrimaryData;
 21  
 import org.jtheque.primary.utils.TempUtils;
 22  
 
 23  
 /**
 24  
  * An implementation of a collection of film.
 25  
  *
 26  
  * @author Baptiste Wicht
 27  
  */
 28  0
 public final class CollectionImpl extends AbstractPrimaryData implements Collection {
 29  
         private String title;
 30  
         private boolean protection;
 31  
         private String password;
 32  
 
 33  
         //Data methods
 34  
 
 35  
         @Override
 36  
         public void setTitle(String title){
 37  0
                 this.title = title;
 38  0
         }
 39  
 
 40  
         @Override
 41  
         public String getTitle(){
 42  0
                 return title;
 43  
         }
 44  
 
 45  
         @Override
 46  
         public boolean isProtection(){
 47  0
                 return protection;
 48  
         }
 49  
 
 50  
         @Override
 51  
         public void setProtection(boolean protection){
 52  0
                 this.protection = protection;
 53  0
         }
 54  
 
 55  
         @Override
 56  
         public String getPassword(){
 57  0
                 return password;
 58  
         }
 59  
 
 60  
         @Override
 61  
         public void setPassword(String password){
 62  0
                 this.password = password;
 63  0
         }
 64  
 
 65  
         //Utility class
 66  
 
 67  
         @Override
 68  
         public String getDisplayableText(){
 69  0
                 return title;
 70  
         }
 71  
 
 72  
         @Override
 73  
         public String toString(){
 74  0
                 return title;
 75  
         }
 76  
 
 77  
         @Override
 78  
         public int hashCode(){
 79  0
                 return TempUtils.hashCodeDirect(title, protection, password);
 80  
         }
 81  
 
 82  
         @Override
 83  
         public boolean equals(Object obj){
 84  0
         if(obj == null){
 85  0
             return false;
 86  
         }
 87  
 
 88  0
                 Collection other = (Collection) obj;
 89  
 
 90  0
                 return TempUtils.areEqualsDirect(this, obj,
 91  
                                 getId(), title, protection, password,
 92  
                                 other.getId(), other.getTitle(), other.isProtection(), other.getPassword());
 93  
         }
 94  
 }