1 /*
2 * Copyright (c) 2002-2025, 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.pluginwizard.business.model;
35
36 import java.io.Serializable;
37 import java.util.ArrayList;
38 import java.util.List;
39
40 import javax.validation.constraints.NotEmpty;
41 import javax.validation.constraints.Pattern;
42
43 /**
44 * This is the business class for the object PluginApplication
45 */
46 public class Application implements Serializable
47 {
48 /**
49 *
50 */
51 private static final long serialVersionUID = 1L;
52 // Variables declarations
53 private int _nId;
54 private List<Integer> _nIdBusinessClasses;
55 @NotEmpty( message = "pluginwizard.error.application.name.notEmpty" )
56 @Pattern( regexp = "[a-z]+", message = "pluginwizard.error.application.name.pattern" )
57 private String _strApplicationName;
58 @NotEmpty( message = "pluginwizard.error.application.class.notEmpty" )
59 @Pattern( regexp = "[A-Z][a-zA-Z]*", message = "pluginwizard.error.application.class.pattern" )
60 private String _strApplicationClass;
61
62 /**
63 * Returns the Id
64 *
65 * @return The Id
66 */
67 public int getId( )
68 {
69 return _nId;
70 }
71
72 /**
73 * Sets the Id
74 *
75 * @param nId
76 * The Id
77 */
78 public void setId( int nId )
79 {
80 _nId = nId;
81 }
82
83 /**
84 * Returns the ApplicationName
85 *
86 * @return The ApplicationName
87 */
88 public String getApplicationName( )
89 {
90 return _strApplicationName;
91 }
92
93 /**
94 * Sets the ApplicationName
95 *
96 * @param strApplicationName
97 * The ApplicationName
98 */
99 public void setApplicationName( String strApplicationName )
100 {
101 _strApplicationName = strApplicationName;
102 }
103
104 /**
105 * Returns the ApplicationClass
106 *
107 * @return The ApplicationClass
108 */
109 public String getApplicationClass( )
110 {
111 return _strApplicationClass;
112 }
113
114 /**
115 * Sets the ApplicationClass
116 *
117 * @param strApplicationClass
118 * The ApplicationClass
119 */
120 public void setApplicationClass( String strApplicationClass )
121 {
122 _strApplicationClass = strApplicationClass;
123 }
124
125 /**
126 * Returns the list of IdBusinessClasses
127 *
128 * @return the collection of IdBusinessClasses
129 */
130 public List<Integer> getIdBusinessClasses( )
131 {
132 if ( _nIdBusinessClasses != null )
133 {
134 return (List<Integer>) ( ( (ArrayList<Integer>) _nIdBusinessClasses ).clone( ) );
135 }
136 else
137 {
138 return null;
139 }
140 }
141
142 /**
143 * Sets the list of IdBusinessClasses
144 *
145 * @param nIdBusinessClasses
146 * The collection of IdBusinessClasses
147 */
148 public void setIdBusinessClasses( List<Integer> nIdBusinessClasses )
149 {
150 if ( nIdBusinessClasses != null )
151 {
152 _nIdBusinessClasses = (List<Integer>) ( ( (ArrayList<Integer>) nIdBusinessClasses ).clone( ) );
153 }
154 else
155 {
156 _nIdBusinessClasses = null;
157 }
158 }
159 }