View Javadoc

1   /*
2   Copyright 2010 James Pether Sörling Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 
3   	$Id
4   */
5   
6   package com.hack23.cia.service.api.admin;
7   
8   import com.hack23.cia.model.application.dto.common.UserSessionDTO;
9   import com.hack23.cia.model.application.impl.common.Agency;
10  import com.hack23.cia.model.application.impl.common.Language;
11  import com.hack23.cia.model.application.impl.common.LanguageContent;
12  
13  /***
14   * The Class LanguageResponse.
15   */
16  public class LanguageResponse extends AbstractConfigurationResponse {
17  
18      /*** The Constant serialVersionUID. */
19      private static final long serialVersionUID = 1L;
20  
21      /*** The language. */
22      private final Language language;
23      
24      /*** The language content. */
25      private final LanguageContent languageContent;
26      
27  
28      /***
29       * Instantiates a new language response.
30       *
31       * @param userSessionDTO the user session dto
32       * @param agency the agency
33       */
34      public LanguageResponse(final UserSessionDTO userSessionDTO, final Agency agency) {
35          super(userSessionDTO,agency);
36          this.language = null;
37          this.languageContent=null;
38      }
39  
40      /***
41       * Instantiates a new language response.
42       *
43       * @param userSessionDTO the user session dto
44       * @param agency the agency
45       * @param language the language
46       */
47      public LanguageResponse(final UserSessionDTO userSessionDTO, final Agency agency,
48              final Language language) {
49          super(userSessionDTO,agency);
50          this.language = language;
51          this.languageContent=null;
52      }
53  
54      /***
55       * Instantiates a new language response.
56       *
57       * @param userSessionDTO the user session dto
58       * @param agency the agency
59       * @param languageContent the language content
60       */
61      public LanguageResponse(final UserSessionDTO userSessionDTO, final Agency agency,
62              final LanguageContent languageContent) {
63          super(userSessionDTO,agency);
64          this.languageContent = languageContent;
65          this.language = languageContent.getLanguage();
66      }
67      
68      /***
69       * Gets the language.
70       *
71       * @return the language
72       */
73      public final Language getLanguage() {
74          return language;
75      }
76  
77      /***
78       * Gets the language content.
79       *
80       * @return the language content
81       */
82      public final LanguageContent getLanguageContent() {
83          return languageContent;
84      }
85  
86  }