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   package com.hack23.cia.web.viewfactory.api.user;
6   
7   import java.util.List;
8   
9   import com.hack23.cia.model.application.dto.common.UserSessionDTO;
10  import com.hack23.cia.model.sweden.impl.ParliamentMember;
11  import com.hack23.cia.model.sweden.impl.ParliamentMemberVoteCompareResult;
12  import com.hack23.cia.model.sweden.impl.RegisterInformation;
13  import com.hack23.cia.model.sweden.impl.Vote;
14  import com.hack23.cia.web.action.common.ControllerAction;
15  
16  /***
17   * The Class ParliamentMemberSummaryModelAndView.
18   */
19  public class ParliamentMemberSummaryModelAndView extends
20          AbstractParliamentMemberModelAndView {
21  
22      /***
23       * The Enum ParliamentMemberSummaryViewSpecification.
24       */
25      public enum ParliamentMemberSummaryViewSpecification {
26  
27          /*** The Parliament member summary view. */
28          ParliamentMemberSummaryView
29      }
30  
31      /*** The Constant serialVersionUID. */
32      private static final long serialVersionUID = 1L;
33  
34      /*** The enemy list. */
35      private final List<ParliamentMemberVoteCompareResult> enemyList;
36  
37      /*** The enemy party list. */
38      private final List<ParliamentMemberVoteCompareResult> enemyPartyList;
39  
40      /*** The friend list. */
41      private final List<ParliamentMemberVoteCompareResult> friendList;
42  
43      /*** The friend party list. */
44      private final List<ParliamentMemberVoteCompareResult> friendPartyList;
45  
46      /*** The parliament member summary view specification. */
47      private final ParliamentMemberSummaryViewSpecification parliamentMemberSummaryViewSpecification;
48  
49      /*** The register information. */
50      private final RegisterInformation registerInformation;
51  
52      /*** The votes. */
53      private final List<Vote> votes;
54  
55      /***
56       * Instantiates a new parliament member summary model and view.
57       *
58       * @param userSessionDTO the user session dto
59       * @param controllerAction the controller action
60       * @param parliamentMemberSummaryViewSpecification the parliament member summary view specification
61       * @param parliamentMember the parliament member
62       * @param friendList the friend list
63       * @param enemyList the enemy list
64       * @param friendPartyList the friend party list
65       * @param enemyPartyList the enemy party list
66       * @param votes the votes
67       * @param registerInformation the register information
68       */
69      public ParliamentMemberSummaryModelAndView(
70              final UserSessionDTO userSessionDTO,
71              final ControllerAction controllerAction,
72              final ParliamentMemberSummaryViewSpecification parliamentMemberSummaryViewSpecification,
73              final ParliamentMember parliamentMember,
74              final List<ParliamentMemberVoteCompareResult> friendList,
75              final List<ParliamentMemberVoteCompareResult> enemyList,
76              final List<ParliamentMemberVoteCompareResult> friendPartyList,
77              final List<ParliamentMemberVoteCompareResult> enemyPartyList,
78              final List<Vote> votes,
79              final RegisterInformation registerInformation) {
80          super(userSessionDTO, controllerAction, parliamentMember);
81          this.parliamentMemberSummaryViewSpecification = parliamentMemberSummaryViewSpecification;
82          this.friendList = friendList;
83          this.enemyList = enemyList;
84          this.friendPartyList = friendPartyList;
85          this.enemyPartyList = enemyPartyList;
86          this.votes = votes;
87          this.registerInformation = registerInformation;
88      }
89  
90      /***
91       * Gets the enemy list.
92       *
93       * @return the enemy list
94       */
95      public final List<ParliamentMemberVoteCompareResult> getEnemyList() {
96          return enemyList;
97      }
98  
99      /***
100      * Gets the enemy party list.
101      *
102      * @return the enemy party list
103      */
104     public final List<ParliamentMemberVoteCompareResult> getEnemyPartyList() {
105         return enemyPartyList;
106     }
107 
108     /***
109      * Gets the friend list.
110      *
111      * @return the friend list
112      */
113     public final List<ParliamentMemberVoteCompareResult> getFriendList() {
114         return friendList;
115     }
116 
117     /***
118      * Gets the friend party list.
119      *
120      * @return the friend party list
121      */
122     public final List<ParliamentMemberVoteCompareResult> getFriendPartyList() {
123         return friendPartyList;
124     }
125 
126     /***
127      * Gets the parliament member summary view specification.
128      *
129      * @return the parliament member summary view specification
130      */
131     public final ParliamentMemberSummaryViewSpecification getParliamentMemberSummaryViewSpecification() {
132         return parliamentMemberSummaryViewSpecification;
133     }
134 
135     /***
136      * Gets the register information.
137      *
138      * @return the register information
139      */
140     public final RegisterInformation getRegisterInformation() {
141         return registerInformation;
142     }
143 
144     /*
145      * (non-Javadoc)
146      * 
147      * @seecom.hack23.cia.web.viewfactory.api.common.AbstractModelAndView#
148      * getViewSpecificationDescription()
149      */
150     @Override
151     public final String getViewSpecificationDescription() {
152         return parliamentMemberSummaryViewSpecification.toString();
153     }
154 
155     /***
156      * Gets the votes.
157      *
158      * @return the votes
159      */
160     public final List<Vote> getVotes() {
161         return votes;
162     }
163 }