View Javadoc
1   /*
2    * Copyright (c) 2002-2018, 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.aot.modules.declarationimmat.business;
35  
36  import fr.paris.lutece.plugins.aot.modules.declarationimmat.utils.TimestampAdapter;
37  import java.io.Serializable;
38  import java.sql.Timestamp;
39  import java.util.ArrayList;
40  import java.util.List;
41  import javax.validation.Valid;
42  import javax.validation.constraints.NotNull;
43  import javax.xml.bind.annotation.XmlElement;
44  import javax.xml.bind.annotation.XmlRootElement;
45  import javax.xml.bind.annotation.XmlTransient;
46  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
47  
48  import org.hibernate.validator.constraints.NotEmpty;
49  
50  /**
51   * This is the business class for the object Site
52   */ 
53  @XmlRootElement( name = "site" )
54  public class Site implements Serializable
55  {
56      private static final long serialVersionUID = 1L;
57  
58      private int _nId;
59      private String _strToken;
60      private Timestamp _dateStartDate;
61      private Timestamp _dateEndDate;
62      private String _strAddress;
63      private String _strLocationCode;
64      private int _nAuthorizationId;
65      private String _strUrl;
66      private List<Place> _places = new ArrayList<>( );
67  
68      @XmlElement( name = "id" )
69      public int getId( )
70      {
71          return _nId;
72      }
73  
74      public void setId( int nId )
75      {
76          _nId = nId;
77      }
78  
79      @NotNull
80      @NotEmpty
81      @XmlElement( name = "address" )
82      public String getAddress( )
83      {
84          return _strAddress;
85      }
86  
87      public void setAddress( String strAddress )
88      {
89          _strAddress = strAddress;
90      }
91  
92      @XmlTransient
93      public int getAuthorizationId( )
94      {
95          return _nAuthorizationId;
96      }
97  
98      public void setAuthorizationId( int nAuthorizationId )
99      {
100         _nAuthorizationId = nAuthorizationId;
101     }
102 
103     @NotNull
104     @NotEmpty
105     @Valid
106     @XmlElement( name = "places" )
107     public List<Place> getPlaces( )
108     {
109         return _places;
110     }
111 
112     public void setPlaces( List<Place> places )
113     {
114         this._places = places;
115     }
116 
117     @NotNull
118     @NotEmpty
119     @XmlElement( name = "locationCode" )
120     public String getLocationCode( )
121     {
122         return _strLocationCode;
123     }
124 
125     public void setLocationCode( String locationCode )
126     {
127         _strLocationCode = locationCode;
128     }
129 
130     @XmlJavaTypeAdapter( TimestampAdapter.class )
131     @XmlElement( name = "startDate" )
132     public Timestamp getStartDate( )
133     {
134         return _dateStartDate;
135     }
136 
137     public void setStartDate( Timestamp startDate )
138     {
139         this._dateStartDate = startDate;
140     }
141 
142     @XmlJavaTypeAdapter( TimestampAdapter.class )
143     @XmlElement( name = "endDate" )
144     public Timestamp getEndDate( )
145     {
146         return _dateEndDate;
147     }
148 
149     public void setEndDate( Timestamp endDate )
150     {
151         this._dateEndDate = endDate;
152     }
153 
154     @XmlElement( name = "token" )
155     public String getToken( )
156     {
157         return _strToken;
158     }
159 
160     public void setToken( String token )
161     {
162         _strToken = token;
163     }
164 
165     @XmlElement( name = "url" )
166     public String getUrl( )
167     {
168         return _strUrl;
169     }
170 
171     public void setUrl( String url )
172     {
173         _strUrl = url;
174     }
175 }