View Javadoc
1   /*
2    * Copyright (c) 2002-2024, City of Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.identitystore.business.duplicates.suspicions;
35  
36  import javax.validation.constraints.NotEmpty;
37  import javax.validation.constraints.Size;
38  import java.io.Serializable;
39  import java.sql.Timestamp;
40  import java.util.HashMap;
41  import java.util.Map;
42  
43  /**
44   * This is the business class for the object SuspiciousIdentity
45   */
46  public class SuspiciousIdentity implements Serializable
47  {
48      private static final long serialVersionUID = 1L;
49  
50      // Variables declarations
51      private int _nId;
52  
53      @NotEmpty( message = "#i18n{module.identitystore.quality.validation.suspiciousidentity.CustomerId.notEmpty}" )
54      @Size( max = 50, message = "#i18n{module.identitystore.quality.validation.suspiciousidentity.CustomerId.size}" )
55      private String _strCustomerId;
56      private String _strDuplicateRuleCode;
57      private Integer _nIdDuplicateRule;
58      private boolean _bIsDeleted;
59      private Timestamp _dateCreationDate;
60      private Timestamp _dateLastUpdateDate;
61      private SuspiciousIdentityLock lock;
62      protected Map<String, String> metadata = new HashMap<>( );
63  
64      /**
65       * Returns the Id
66       * 
67       * @return The Id
68       */
69      public int getId( )
70      {
71          return _nId;
72      }
73  
74      /**
75       * Sets the Id
76       * 
77       * @param nId
78       *            The Id
79       */
80      public void setId( int nId )
81      {
82          _nId = nId;
83      }
84  
85      /**
86       * Returns the CustomerId
87       * 
88       * @return The CustomerId
89       */
90      public String getCustomerId( )
91      {
92          return _strCustomerId;
93      }
94  
95      /**
96       * Sets the CustomerId
97       * 
98       * @param strCustomerId
99       *            The CustomerId
100      */
101     public void setCustomerId( String strCustomerId )
102     {
103         _strCustomerId = strCustomerId;
104     }
105 
106     /**
107      * Gets the duplicate rule ID used to detect this suspicious identity
108      * 
109      * @return the duplicate rule ID
110      */
111     public Integer getIdDuplicateRule( )
112     {
113         return _nIdDuplicateRule;
114     }
115 
116     /**
117      * Sets the duplicate rule ID used to detect this suspicious identity
118      * 
119      * @param _nIdDuplicateRule
120      *            the duplicate rule ID
121      */
122     public void setIdDuplicateRule( int _nIdDuplicateRule )
123     {
124         this._nIdDuplicateRule = _nIdDuplicateRule;
125     }
126 
127     /**
128      * Gets the duplicate rule code used to detect this suspicious identity
129      *
130      * @return the duplicate rule code
131      */
132     public String getDuplicateRuleCode( )
133     {
134         return _strDuplicateRuleCode;
135     }
136 
137     /**
138      * Sets the duplicate rule code used to detect this suspicious identity
139      *
140      * @param _strDuplicateRuleCode
141      *            the duplicate rule code
142      */
143     public void setDuplicateRuleCode( String _strDuplicateRuleCode )
144     {
145         this._strDuplicateRuleCode = _strDuplicateRuleCode;
146     }
147 
148     public Timestamp getCreationDate( )
149     {
150         return _dateCreationDate;
151     }
152 
153     public void setCreationDate( Timestamp creationDate )
154     {
155         this._dateCreationDate = creationDate;
156     }
157 
158     public Timestamp getLastUpdateDate( )
159     {
160         return _dateLastUpdateDate;
161     }
162 
163     public void setLastUpdateDate( Timestamp lastUpdateDate )
164     {
165         this._dateLastUpdateDate = lastUpdateDate;
166     }
167 
168     public boolean isDeleted( )
169     {
170         return _bIsDeleted;
171     }
172 
173     /**
174      * set true if all the attibutes of identity are deleted
175      *
176      * @param bIsDeleted
177      *            if identity removed (softDelete)
178      */
179     public void setDeleted( boolean bIsDeleted )
180     {
181         _bIsDeleted = bIsDeleted;
182     }
183 
184     public SuspiciousIdentityLock getLock( )
185     {
186         return lock;
187     }
188 
189     public void setLock( SuspiciousIdentityLock lock )
190     {
191         this.lock = lock;
192     }
193 
194     public Map<String, String> getMetadata( )
195     {
196         return metadata;
197     }
198 
199     public void setMetadata( Map<String, String> metadata )
200     {
201         this.metadata = metadata;
202     }
203 }