Coverage Report - com.buckosoft.fibs.domain.PlayerGroup
 
Classes in this File Line Coverage Branch Coverage Complexity
PlayerGroup
100%
23/23
N/A
1
 
 1  
 /******************************************************************************
 2  
  * PlayerGroup.java - Associate Players with groups
 3  
  * $Id$
 4  
  * 
 5  
  * BuckoFIBS - Backgammon by BuckoSoft
 6  
  * Copyright© 2010 - Dick Balaska - BuckoSoft, Corp.
 7  
  * 
 8  
  * $Log$
 9  
  * Revision 1.2  2011/01/01 02:30:36  dick
 10  
  * Two flags, dirty and tagForDelete.
 11  
  *
 12  
  * Revision 1.1  2011/01/01 00:17:12  dick
 13  
  * PlayerGroup had to move to a top level domain object so that the hibernate mapping would work.
 14  
  * It doesn't like mapping to subclasses.
 15  
  *
 16  
  */
 17  
 
 18  
 /* 
 19  
  * This program is free software: you can redistribute it and/or modify
 20  
  * it under the terms of the GNU General Public License as published by
 21  
  * the Free Software Foundation, either version 3 of the License, or
 22  
  * (at your option) any later version.
 23  
  *
 24  
  * This program is distributed in the hope that it will be useful,
 25  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 26  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 27  
  * GNU General Public License for more details.
 28  
  *
 29  
  * You should have received a copy of the GNU General Public License
 30  
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 31  
  *
 32  
  * The Original Code is BuckoFIBS, <http://www.buckosoft.com/BuckoFIBS/>.
 33  
  * The Initial Developer of the Original Code is Dick Balaska and BuckoSoft, Corp.
 34  
  * 
 35  
  */
 36  
 package com.buckosoft.fibs.domain;
 37  
 
 38  
 /** Associate Players with groups
 39  
  * @author Dick Balaska
 40  
  * @since 2010/12/31
 41  
  * @version $Revision$ <br> $Date$
 42  
  * @see <a href="http://cvs.buckosoft.com/Projects/BuckoFIBS/BuckoFIBS/src/main/java/com/buckosoft/fibs/domain/PlayerGroup.java">cvs PlayerGroup.java</a>
 43  
  */
 44  
 public class PlayerGroup {
 45  
         private int id;
 46  
         private int groupId;
 47  
         private        int playerId;
 48  27
         private        boolean        dirty = true;
 49  27
         private        boolean        tagForDelete = false;
 50  
         
 51  
         /** Construct an empty PlayerGroup
 52  
          */
 53  38
         public PlayerGroup() {}
 54  
         
 55  
         /** Convienence constructor that initializes the fields.
 56  
          * @param groupId The groupId of this new PlayerGroup.
 57  
          * @param playerId The playerId of this new PlayerGroup.
 58  
          */
 59  8
         public PlayerGroup(int groupId, int playerId) {
 60  8
                 this.groupId = groupId;
 61  8
                 this.playerId = playerId;
 62  8
         }
 63  
 
 64  
         /**
 65  
          * @return the id
 66  
          */
 67  
         public int getId() {
 68  18
                 return id;
 69  
         }
 70  
         /**
 71  
          * @param id the id to set
 72  
          */
 73  
         public void setId(int id) {
 74  8
                 this.id = id;
 75  8
         }
 76  
         /**
 77  
          * @return the groupId
 78  
          */
 79  
         public int getGroupId() {
 80  18
                 return groupId;
 81  
         }
 82  
         /**
 83  
          * @param groupId the groupId to set
 84  
          */
 85  
         public void setGroupId(int groupId) {
 86  7
                 this.groupId = groupId;
 87  7
         }
 88  
         /**
 89  
          * @return the playerId
 90  
          */
 91  
         public int getPlayerId() {
 92  22
                 return playerId;
 93  
         }
 94  
         /**
 95  
          * @param playerId the playerId to set
 96  
          */
 97  
         public void setPlayerId(int playerId) {
 98  4
                 this.playerId = playerId;
 99  4
         }
 100  
 
 101  
         /** Does this PlayerGroup need saving?
 102  
          * @return the dirty
 103  
          */
 104  
         public boolean isDirty() {
 105  9
                 return dirty;
 106  
         }
 107  
 
 108  
         /** 
 109  
          * @param dirty the dirty to set
 110  
          */
 111  
         public void setDirty(boolean dirty) {
 112  10
                 this.dirty = dirty;
 113  10
         }
 114  
 
 115  
         /**
 116  
          * @return the tagForDelete
 117  
          */
 118  
         public boolean isTagForDelete() {
 119  6
                 return tagForDelete;
 120  
         }
 121  
 
 122  
         /**
 123  
          * @param tagForDelete the tagForDelete to set
 124  
          */
 125  
         public void setTagForDelete() {
 126  2
                 this.tagForDelete = true;
 127  2
                 this.dirty = true;
 128  2
         }
 129  
 
 130  
         
 131  
 }
 132