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 javax.xml.bind.annotation.XmlElement;
37  import javax.xml.bind.annotation.XmlRootElement;
38  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
39  
40  import fr.paris.lutece.plugins.aot.modules.declarationimmat.utils.TimestampAdapter;
41  import fr.paris.lutece.plugins.aot.modules.declarationimmat.utils.TypeVehicleAdapter;
42  
43  import java.io.Serializable;
44  import java.sql.Timestamp;
45  
46  /**
47   * This is the business class for the object Ticket
48   */ 
49  @XmlRootElement( name = "ticket" )
50  public class Ticket implements Serializable
51  {
52      private static final long serialVersionUID = 1L;
53  
54      private int _nId;
55      private Timestamp _dateDeclarationStartDate;
56      private Timestamp _dateDeclarationEndDate;
57      private Timestamp _dateStartDate;
58      private Timestamp _dateEndDate;
59      private String _strLicensePlate;
60      private String _strTicketReference;
61      private TypeVehicle _typeVehicle;
62      private Boolean _bSuspended = false;
63      private int _nPlaceId;
64  
65      @XmlElement( name = "id" )
66      public int getId( )
67      {
68          return _nId;
69      }
70  
71      public void setId( int nId )
72      {
73          _nId = nId;
74      }
75  
76      @XmlJavaTypeAdapter( TimestampAdapter.class )
77      @XmlElement( name = "startDate" )
78      public Timestamp getStartDate( )
79      {
80          return _dateStartDate;
81      }
82  
83      public void setStartDate( Timestamp dateStartDate )
84      {
85          _dateStartDate = dateStartDate;
86      }
87  
88      @XmlJavaTypeAdapter( TimestampAdapter.class )
89      @XmlElement( name = "endDate" )
90      public Timestamp getEndDate( )
91      {
92          return _dateEndDate;
93      }
94  
95      public void setEndDate( Timestamp dateEndDate )
96      {
97          _dateEndDate = dateEndDate;
98      }
99  
100     @XmlJavaTypeAdapter( TimestampAdapter.class )
101     @XmlElement( name = "declarationStartDate" )
102     public Timestamp getDeclarationStartDate( )
103     {
104         return _dateDeclarationStartDate;
105     }
106 
107     public void setDeclarationStartDate( Timestamp dateDeclarationStartDate )
108     {
109         _dateDeclarationStartDate = dateDeclarationStartDate;
110     }
111 
112     @XmlJavaTypeAdapter( TimestampAdapter.class )
113     @XmlElement( name = "declarationEndDate" )
114     public Timestamp getDeclarationEndDate( )
115     {
116         return _dateDeclarationEndDate;
117     }
118 
119     public void setDeclarationEndDate( Timestamp dateDeclarationEndDate )
120     {
121         _dateDeclarationEndDate = dateDeclarationEndDate;
122     }
123 
124     @XmlElement( name = "licensePlate" )
125     public String getLicensePlate( )
126     {
127         return _strLicensePlate;
128     }
129 
130     public void setLicensePlate( String strLicensePlate )
131     {
132         _strLicensePlate = strLicensePlate;
133     }
134 
135     @XmlElement( name = "ticketReference" )
136     public String getTicketReference( )
137     {
138         return _strTicketReference;
139     }
140 
141     public void setTicketReference( String strTicketReference )
142     {
143         _strTicketReference = strTicketReference;
144     }
145 
146     @XmlElement( name = "placeId" )
147     public int getPlaceId( )
148     {
149         return _nPlaceId;
150     }
151 
152     public void setPlaceId( int nPlaceId )
153     {
154         _nPlaceId = nPlaceId;
155     }
156 
157     @XmlElement( name = "suspended" )
158     public Boolean getSuspended( )
159     {
160         return _bSuspended;
161     }
162 
163     public void setSuspended( Boolean suspended )
164     {
165         _bSuspended = suspended;
166     }
167 
168     @XmlJavaTypeAdapter( TypeVehicleAdapter.class )
169     @XmlElement( name = "typeVehicle" )
170     public TypeVehicle getTypeVehicle( )
171     {
172         return _typeVehicle;
173     }
174 
175     public void setTypeVehicle( TypeVehicle typeVehicle )
176     {
177         _typeVehicle = typeVehicle;
178     }
179 
180     public void setTypeVehicleAsString( String typeVehicle )
181     {
182         setTypeVehicle( TypeVehicle.fromCode( typeVehicle ) );
183     }
184 }