1
2
3
4
5
6 package com.hack23.cia.model.application.impl.common;
7
8 import com.hack23.cia.model.sweden.impl.Ballot;
9 import com.hack23.cia.model.sweden.impl.CommitteeReport;
10 import com.hack23.cia.model.sweden.impl.ParliamentMember;
11 import com.hack23.cia.model.sweden.impl.PoliticalParty;
12
13 /***
14 * The Enum ParliamentChart.
15 */
16 public enum ParliamentChart {
17
18 /*** The Outcome. */
19 Outcome,
20
21 /*** The Political party behavior. */
22 PoliticalPartyBehavior,
23
24 /*** The Proffessional behavior. */
25 ProffessionalBehavior,
26
27 /*** The Summary. */
28 Summary;
29
30 /*** The Constant FILE_EXTENSION. */
31 public static final String FILE_EXTENSION = ".png";
32
33 /***
34 * Gets the file name.
35 *
36 * @param chart the chart
37 * @param ballot the ballot
38 * @param language the language
39 * @return the file name
40 */
41 public static final String getFileName(final ParliamentChart chart, final Ballot ballot,
42 final Language language) {
43 return chart.toString() +"-ballot-" + ballot.getId() +"-"+ language.getShortCode() + FILE_EXTENSION;
44
45 }
46
47 /***
48 * Gets the file name.
49 *
50 * @param chart the chart
51 * @param committeeReport the committee report
52 * @param language the language
53 * @return the file name
54 */
55 public static final String getFileName(final ParliamentChart chart,
56 final CommitteeReport committeeReport,final Language language) {
57 return chart.toString() +"-committeeReport-" + committeeReport.getId() +"-"+ language.getShortCode() + FILE_EXTENSION;
58 }
59
60 /***
61 * Gets the file name.
62 *
63 * @param chart the chart
64 * @param language the language
65 * @return the file name
66 */
67 public static final String getFileName(final ParliamentChart chart,
68 final Language language) {
69 return chart.toString() + "-" + language.getShortCode() + FILE_EXTENSION;
70 }
71
72 /***
73 * Gets the file name.
74 *
75 * @param chart the chart
76 * @param parliamentMember the parliament member
77 * @param language the language
78 * @return the file name
79 */
80 public static final String getFileName(final ParliamentChart chart,
81 final ParliamentMember parliamentMember, final Language language) {
82 return chart.toString() +"-parliamentMember-" + parliamentMember.getId() +"-"+ language.getShortCode() + FILE_EXTENSION;
83 }
84
85 /***
86 * Gets the file name.
87 *
88 * @param chart the chart
89 * @param politicalParty the political party
90 * @param language the language
91 * @return the file name
92 */
93 public static final String getFileName(final ParliamentChart chart,final PoliticalParty politicalParty,
94 final Language language) {
95 return chart.toString() +"-party-" + politicalParty.getShortCode() +"-"+ language.getShortCode() + FILE_EXTENSION;
96 }
97 }