View Javadoc
1   /*
2    * Copyright (c) 2011-2024 PrimeFaces Extensions
3    *
4    *  Permission is hereby granted, free of charge, to any person obtaining a copy
5    *  of this software and associated documentation files (the "Software"), to deal
6    *  in the Software without restriction, including without limitation the rights
7    *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    *  copies of the Software, and to permit persons to whom the Software is
9    *  furnished to do so, subject to the following conditions:
10   *
11   *  The above copyright notice and this permission notice shall be included in
12   *  all copies or substantial portions of the Software.
13   *
14   *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20   *  THE SOFTWARE.
21   */
22  package org.primefaces.extensions.component.sheet;
23  
24  import java.io.Serializable;
25  import java.util.Objects;
26  
27  /**
28   * Class used to represent an invalid row/cell.
29   *
30   * @author Mark Lassiter / Melloware
31   * @since 6.2
32   */
33  public class SheetInvalidUpdate implements Serializable {
34  
35      private static final long serialVersionUID = 1L;
36  
37      private transient Object invalidRowKey;
38  
39      private int invalidColIndex;
40  
41      private transient SheetColumn invalidColumn;
42  
43      private transient Object invalidValue;
44  
45      private String invalidMessage;
46  
47      public SheetInvalidUpdate(Object invalidRowKey, int invalidColIndex, SheetColumn invalidColumn, Object invalidValue, String invalidMessage) {
48          super();
49          this.invalidRowKey = invalidRowKey;
50          this.invalidColIndex = invalidColIndex;
51          this.invalidColumn = invalidColumn;
52          this.invalidValue = invalidValue;
53          this.invalidMessage = invalidMessage;
54      }
55  
56      @Override
57      public boolean equals(Object o) {
58          if (this == o) {
59              return true;
60          }
61          if (!(o instanceof SheetInvalidUpdate)) {
62              return false;
63          }
64          SheetInvalidUpdate that = (SheetInvalidUpdate) o;
65          return getInvalidColIndex() == that.getInvalidColIndex() &&
66                      Objects.equals(getInvalidRowKey(), that.getInvalidRowKey());
67      }
68  
69      @Override
70      public int hashCode() {
71          return Objects.hash(getInvalidRowKey(), getInvalidColIndex());
72      }
73  
74      public Object getInvalidRowKey() {
75          return invalidRowKey;
76      }
77  
78      public void setInvalidRowKey(Object invalidRowKey) {
79          this.invalidRowKey = invalidRowKey;
80      }
81  
82      public int getInvalidColIndex() {
83          return invalidColIndex;
84      }
85  
86      public void setInvalidColIndex(int invalidColIndex) {
87          this.invalidColIndex = invalidColIndex;
88      }
89  
90      public SheetColumn getInvalidColumn() {
91          return invalidColumn;
92      }
93  
94      public void setInvalidColumn(SheetColumn invalidColumn) {
95          this.invalidColumn = invalidColumn;
96      }
97  
98      public Object getInvalidValue() {
99          return invalidValue;
100     }
101 
102     public void setInvalidValue(Object invalidValue) {
103         this.invalidValue = invalidValue;
104     }
105 
106     public String getInvalidMessage() {
107         return invalidMessage;
108     }
109 
110     public void setInvalidMessage(String invalidMessage) {
111         this.invalidMessage = invalidMessage;
112     }
113 
114 }