View Javadoc
1   /*
2    * Copyright (c) 2002-2014, Mairie de 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.dila.business.fichelocale.dto;
35  
36  import java.io.Serializable;
37  import java.util.Date;
38  
39  
40  /**
41   * DTO for dila_xml table
42   */
43  public class XmlDTO implements Serializable
44  {
45      /** Serial ID */
46      private static final long serialVersionUID = 6791880867164758677L;
47  
48      /**
49       * The id
50       */
51      private Long _lId;
52  
53      /**
54       * The id xml
55       */
56      private String _strIdXml;
57  
58      /**
59       * The title
60       */
61      private String _strTitle;
62  
63      /**
64       * The breadcrumb of resource
65       */
66      private String _strBreadCrumb;
67  
68      /**
69       * The id of audience
70       */
71      private Long _lIdAudience;
72  
73      /**
74       * Type resource
75       */
76      private String _strResourceType;
77  
78      /**
79       * Date modif
80       */
81      private Date _creationDate;
82  
83      /**
84       * Date modif
85       */
86      private Date _modificationDate;
87  
88      /**
89       * @return the _lId
90       */
91      public Long getId( )
92      {
93          return _lId;
94      }
95  
96      /**
97       * @param lId the _lId to set
98       */
99      public void setId( Long lId )
100     {
101         this._lId = lId;
102     }
103 
104     /**
105      * @return the _strIdXml
106      */
107     public String getIdXml( )
108     {
109         return _strIdXml;
110     }
111 
112     /**
113      * @param strIdXml the _strIdXml to set
114      */
115     public void setIdXml( String strIdXml )
116     {
117         this._strIdXml = strIdXml;
118     }
119 
120     /**
121      * @return the _strTitle
122      */
123     public String getTitle( )
124     {
125         return _strTitle;
126     }
127 
128     /**
129      * @param strTitle the _strTitle to set
130      */
131     public void setTitle( String strTitle )
132     {
133         this._strTitle = strTitle;
134     }
135 
136     /**
137      * @return the _strBreadCrumb
138      */
139     public String getBreadCrumb( )
140     {
141         return _strBreadCrumb;
142     }
143 
144     /**
145      * @param strBreadCrumb the _strBreadCrumb to set
146      */
147     public void setBreadCrumb( String strBreadCrumb )
148     {
149         this._strBreadCrumb = strBreadCrumb;
150     }
151 
152     /**
153      * @return the _lIdAudience
154      */
155     public Long getIdAudience( )
156     {
157         return _lIdAudience;
158     }
159 
160     /**
161      * @param lIdAudience the _lIdAudience to set
162      */
163     public void setIdAudience( Long lIdAudience )
164     {
165         this._lIdAudience = lIdAudience;
166     }
167 
168     /**
169      * @return the _strResourceType
170      */
171     public String getResourceType( )
172     {
173         return _strResourceType;
174     }
175 
176     /**
177      * @param strResourceType the _strResourceType to set
178      */
179     public void setResourceType( String strResourceType )
180     {
181         this._strResourceType = strResourceType;
182     }
183 
184     /**
185      * @return the _modificationDate
186      */
187     public Date getModificationDate( )
188     {
189         if ( _modificationDate != null )
190         {
191             return (Date) _modificationDate.clone( );
192         }
193         else
194         {
195             return null;
196         }
197     }
198 
199     /**
200      * @param modificationDate the _modificationDate to set
201      */
202     public void setModificationDate( Date modificationDate )
203     {
204         if ( modificationDate != null )
205         {
206             this._modificationDate = (Date) modificationDate.clone( );
207         }
208     }
209 
210     /**
211      * @return the _creationDate
212      */
213     public Date getCreationDate( )
214     {
215         return (Date) _creationDate.clone( );
216     }
217 
218     /**
219      * @param creationDate the _creationDate to set
220      */
221     public void setCreationDate( Date creationDate )
222     {
223         this._creationDate = (Date) creationDate.clone( );
224     }
225 
226     /*
227      * (non-Javadoc)
228      * 
229      * @see java.lang.Object#hashCode()
230      */
231     @Override
232     public int hashCode( )
233     {
234         final int prime = 31;
235         int result = 1;
236         result = ( prime * result ) + ( ( _lIdAudience == null ) ? 0 : _lIdAudience.hashCode( ) );
237         result = ( prime * result ) + ( ( _strIdXml == null ) ? 0 : _strIdXml.hashCode( ) );
238 
239         return result;
240     }
241 
242     /*
243      * (non-Javadoc)
244      * 
245      * @see java.lang.Object#equals(java.lang.Object)
246      */
247     @Override
248     public boolean equals( Object obj )
249     {
250         if ( this == obj )
251         {
252             return true;
253         }
254 
255         if ( obj == null )
256         {
257             return false;
258         }
259 
260         if ( getClass( ) != obj.getClass( ) )
261         {
262             return false;
263         }
264 
265         XmlDTO other = (XmlDTO) obj;
266 
267         if ( _lIdAudience == null )
268         {
269             if ( other._lIdAudience != null )
270             {
271                 return false;
272             }
273         }
274         else if ( !_lIdAudience.equals( other._lIdAudience ) )
275         {
276             return false;
277         }
278 
279         if ( _strIdXml == null )
280         {
281             if ( other._strIdXml != null )
282             {
283                 return false;
284             }
285         }
286         else if ( !_strIdXml.equals( other._strIdXml ) )
287         {
288             return false;
289         }
290 
291         return true;
292     }
293 }