View Javadoc
1   /*
2    * Copyright 2010 James Pether Sörling
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *   http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   *	$Id$
17   *  $HeadURL$
18  */
19  package com.hack23.cia.service.api.action.user;
20  
21  import java.util.ArrayList;
22  import java.util.List;
23  import java.util.Map;
24  import java.util.stream.Collectors;
25  
26  import com.hack23.cia.model.external.riksdagen.documentcontent.impl.DocumentContentData;
27  import com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentElement;
28  import com.hack23.cia.model.external.riksdagen.dokumentstatus.impl.DocumentStatusContainer;
29  import com.hack23.cia.service.api.action.common.AbstractResponse;
30  
31  
32  /**
33   * The Class SearchDocumentResponse.
34   */
35  public final class SearchDocumentResponse extends AbstractResponse {
36  
37  	/** The Constant serialVersionUID. */
38  	private static final long serialVersionUID = 1L;
39  
40  	/** The result element. */
41  	private List<DocumentElement> resultElement = new ArrayList<>();
42  
43  	/** The status map. */
44  	private Map<String,DocumentStatusContainer> statusMap;
45  
46  	/** The data map. */
47  	private Map<String,DocumentContentData> dataMap;
48  
49  
50  	/**
51  	 * Instantiates a new search document response.
52  	 *
53  	 * @param result
54  	 *            the result
55  	 */
56  	public SearchDocumentResponse(final ServiceResult result) {
57  		super(result);
58  	}
59  
60  
61  	/**
62  	 * Gets the result element.
63  	 *
64  	 * @return the result element
65  	 */
66  	public List<DocumentElement> getResultElement() {
67  		return resultElement.stream().collect(Collectors.toList());
68  	}
69  
70  
71  	/**
72  	 * Sets the result element.
73  	 *
74  	 * @param resultElement
75  	 *            the new result element
76  	 */
77  	public void setResultElement(final List<DocumentElement> resultElement) {
78  		if (resultElement != null) {
79  			this.resultElement = resultElement.stream().collect(Collectors.toList());
80  		}
81  	}
82  
83  
84  	/**
85  	 * Gets the status map.
86  	 *
87  	 * @return the status map
88  	 */
89  	public Map<String, DocumentStatusContainer> getStatusMap() {
90  		return statusMap;
91  	}
92  
93  
94  	/**
95  	 * Sets the status map.
96  	 *
97  	 * @param statusMap
98  	 *            the new status map
99  	 */
100 	public void setStatusMap(final Map<String, DocumentStatusContainer> statusMap) {
101 		this.statusMap = statusMap;
102 	}
103 
104 
105 	/**
106 	 * Gets the data map.
107 	 *
108 	 * @return the data map
109 	 */
110 	public Map<String, DocumentContentData> getDataMap() {
111 		return dataMap;
112 	}
113 
114 
115 	/**
116 	 * Sets the data map.
117 	 *
118 	 * @param dataMap
119 	 *            the new data map
120 	 */
121 	public void setDataMap(final Map<String, DocumentContentData> dataMap) {
122 		this.dataMap = dataMap;
123 	}
124 
125 }