1 package com.atlassian.plugins.codegen.modules.jira;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6 import com.atlassian.plugins.codegen.modules.BasicClassModuleProperties;
7 import com.atlassian.plugins.codegen.modules.common.Resource;
8
9
10
11
12 public class SearchRequestViewProperties extends BasicClassModuleProperties
13 {
14
15 public static final String FILE_EXTENSION = "FILE_EXTENSION";
16 public static final String CONTENT_TYPE = "CONTENT_TYPE";
17 public static final String RESOURCES = "RESOURCES";
18 public static final String ORDER = "ORDER";
19
20 public SearchRequestViewProperties()
21 {
22 this("MySearchRequestView");
23 }
24
25 public SearchRequestViewProperties(String fqClassName)
26 {
27 super(fqClassName);
28 setResources(new ArrayList<Resource>());
29 setOrder(10);
30 }
31
32 public void setResources(List<Resource> resources)
33 {
34 put(RESOURCES, resources);
35 }
36
37 public List<Resource> getResources()
38 {
39 return (List<Resource>) get(RESOURCES);
40 }
41
42 public void addResource(Resource resource)
43 {
44 List<Resource> resources = getResources();
45 if (null == resources)
46 {
47 resources = new ArrayList<Resource>();
48 setResources(resources);
49 }
50
51 resources.add(resource);
52 }
53
54 public void setContentType(String type)
55 {
56 setProperty(CONTENT_TYPE, type);
57 }
58
59 public String getContentType()
60 {
61 return getProperty(CONTENT_TYPE);
62 }
63
64 public void setFileExtension(String ext)
65 {
66 setProperty(FILE_EXTENSION, ext);
67 }
68
69 public String getFileExtension()
70 {
71 return getProperty(FILE_EXTENSION);
72 }
73
74 public void setOrder(int order)
75 {
76 setProperty(ORDER, Integer.toString(order));
77 }
78
79 public String getOrder()
80 {
81 return getProperty(ORDER);
82 }
83
84 public int getOrderAsInt()
85 {
86 return Integer.parseInt(getProperty(ORDER));
87 }
88 }