View Javadoc
1   package fr.ifremer.tutti.service.pupitri.csv;
2   
3   /*
4    * #%L
5    * Tutti :: Service
6    * %%
7    * Copyright (C) 2012 - 2014 Ifremer
8    * %%
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU General Public License as
11   * published by the Free Software Foundation, either version 3 of the 
12   * License, or (at your option) any later version.
13   * 
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * 
19   * You should have received a copy of the GNU General Public 
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/gpl-3.0.html>.
22   * #L%
23   */
24  
25  import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
26  import fr.ifremer.tutti.service.pupitri.Directions;
27  import org.apache.commons.lang3.time.DateUtils;
28  
29  import java.io.Serializable;
30  import java.util.Date;
31  
32  /**
33   * @author Kevin Morin - kmorin@codelutin.com
34   * @since 1.2
35   */
36  public class TrunkRow implements Serializable {
37  
38      private static final long serialVersionUID = 1L;
39  
40      public static final String PROPERTY_FILE_ORIGIN = "fileOrigin";
41  
42      public static final String PROPERTY_DATE = "date";
43  
44      public static final String PROPERTY_TIME = "time";
45  
46      public static final String PROPERTY_BALANCE_ID = "balanceId";
47  
48      public static final String PROPERTY_SIGN = "sign";
49  
50      public static final String PROPERTY_OPERATION_CODE = "operationCode";
51  
52      public static final String PROPERTY_RIG_NUMBER = "rigNumber";
53  
54      public static final String PROPERTY_DIRECTION = "direction";
55  
56      public static final String PROPERTY_WEIGHT = "weight";
57  
58      public static final String PROPERTY_EMPTY = "";
59  
60      protected String operationCode;
61  
62      protected Date date;
63  
64      protected Directions direction;
65  
66      protected Float weight;
67  
68      public boolean acceptOperation(FishingOperation operation) {
69          return operationCode.equals(operation.getStationNumber())
70                 && DateUtils.isSameDay(date, operation.getGearShootingStartDate());
71      }
72  
73      public String getOperationCode() {
74          return operationCode;
75      }
76  
77      public void setOperationCode(String operationCode) {
78          this.operationCode = operationCode;
79      }
80  
81      public Date getDate() {
82          return date;
83      }
84  
85      public void setDate(Date date) {
86          this.date = date;
87      }
88  
89      public Directions getDirection() {
90          return direction;
91      }
92  
93      public void setDirection(Directions direction) {
94          this.direction = direction;
95      }
96  
97      public Float getWeight() {
98          return weight;
99      }
100 
101     public void setWeight(Float weight) {
102         this.weight = weight;
103     }
104 
105 }