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.easyrulesbot.service.yaml.model;
35  
36  import java.util.List;
37  
38  /**
39   * YamlBot
40   */
41  public class YamlBot
42  {
43      // Variables declarations
44      private String _strKey;
45      private String _strName;
46      private String _strDescription;
47      private String _strLanguage;
48      private String _strWelcomeMessage;
49      private String _strAvatarUrl;
50      private List<YamlRule> _listRules;
51      private List<YamlFilter> _listFilters;
52      private boolean _bStandalone;
53  
54      /**
55       * Returns the Key
56       *
57       * @return The Key
58       */
59      public String getKey( )
60      {
61          return _strKey;
62      }
63  
64      /**
65       * Sets the Key
66       *
67       * @param strKey
68       *            The Key
69       */
70      public void setKey( String strKey )
71      {
72          _strKey = strKey;
73      }
74  
75      /**
76       * Returns the Name
77       *
78       * @return The Name
79       */
80      public String getName( )
81      {
82          return _strName;
83      }
84  
85      /**
86       * Sets the Name
87       *
88       * @param strName
89       *            The Name
90       */
91      public void setName( String strName )
92      {
93          _strName = strName;
94      }
95  
96      /**
97       * Returns the Description
98       *
99       * @return The Description
100      */
101     public String getDescription( )
102     {
103         return _strDescription;
104     }
105 
106     /**
107      * Sets the Description
108      *
109      * @param strDescription
110      *            The Description
111      */
112     public void setDescription( String strDescription )
113     {
114         _strDescription = strDescription;
115     }
116 
117     /**
118      * Returns the Language
119      *
120      * @return The Language
121      */
122     public String getLanguage( )
123     {
124         return _strLanguage;
125     }
126 
127     /**
128      * Sets the Language
129      *
130      * @param strLanguage
131      *            The Language
132      */
133     public void setLanguage( String strLanguage )
134     {
135         _strLanguage = strLanguage;
136     }
137 
138     /**
139      * Returns the WelcomeMessage
140      *
141      * @return The WelcomeMessage
142      */
143     public String getWelcomeMessage( )
144     {
145         return _strWelcomeMessage;
146     }
147 
148     /**
149      * Sets the WelcomeMessage
150      *
151      * @param strWelcomeMessage
152      *            The WelcomeMessage
153      */
154     public void setWelcomeMessage( String strWelcomeMessage )
155     {
156         _strWelcomeMessage = strWelcomeMessage;
157     }
158 
159     /**
160      * Returns the AvatarUrl
161      *
162      * @return The AvatarUrl
163      */
164     public String getAvatarUrl( )
165     {
166         return _strAvatarUrl;
167     }
168 
169     /**
170      * Sets the AvatarUrl
171      *
172      * @param strAvatarUrl
173      *            The AvatarUrl
174      */
175     public void setAvatarUrl( String strAvatarUrl )
176     {
177         _strAvatarUrl = strAvatarUrl;
178     }
179 
180     /**
181      * Returns the Standalone
182      *
183      * @return The Standalone
184      */
185     public boolean getStandalone( )
186     {
187         return _bStandalone;
188     }
189 
190     /**
191      * Sets the Standalone
192      *
193      * @param bStandalone
194      *            The Standalone
195      */
196     public void setStandalone( boolean bStandalone )
197     {
198         _bStandalone = bStandalone;
199     }
200 
201     /**
202      * Returns the Rules
203      *
204      * @return The Rules
205      */
206     public List<YamlRule> getRules( )
207     {
208         return _listRules;
209     }
210 
211     /**
212      * Sets the Rules
213      *
214      * @param listRules
215      *            The Rules
216      */
217     public void setRules( List<YamlRule> listRules )
218     {
219         _listRules = listRules;
220     }
221 
222     /**
223      * Returns the Filters
224      *
225      * @return The Filters
226      */
227     public List<YamlFilter> getFilters( )
228     {
229         return _listFilters;
230     }
231 
232     /**
233      * Sets the Filters
234      *
235      * @param listFilters
236      *            The Filters
237      */
238     public void setFilters( List<YamlFilter> listFilters )
239     {
240         _listFilters = listFilters;
241     }
242 
243     /**
244      * {@inheritDoc }
245      */
246     @Override
247     public String toString()
248     {
249         StringBuilder sbOutput = new StringBuilder( "\nEASYRULE BOT\n");
250         sbOutput.append( "\n key : " ).append( _strKey );
251         sbOutput.append( "\n name : " ).append( _strName );
252         sbOutput.append( "\n language : " ).append( _strLanguage );
253         sbOutput.append( "\n description : " ).append( _strDescription );
254         sbOutput.append( "\n avatar URL : " ).append( _strAvatarUrl );
255         sbOutput.append( "\n welcome message : " ).append( _strWelcomeMessage );
256         sbOutput.append( "\n Rules : " );
257         for( YamlRule rule : _listRules )
258         {
259             sbOutput.append( "\n  " ).append( rule );
260         }
261         return sbOutput.toString();
262     }
263 
264     
265 }