Projekt

Obecné

Profil

Stáhnout (1.15 KB) Statistiky
| Větev: | Tag: | Revize:
1
import java.util.HashMap;
2

    
3
public class jDeserializeResults {
4
	
5
	private final Boolean TEST;
6
	private final Boolean NON_TEST;
7

    
8
	// Boolean == true => test data.
9
	private HashMap<Boolean, String> html;
10
	private HashMap<Boolean, String> json;
11
	
12
	public jDeserializeResults() {
13
		TEST = true;
14
		NON_TEST = false;
15
		
16
		html = new HashMap<Boolean, String>();
17
		json = new HashMap<Boolean, String>();
18
		
19
		html.put(TEST, new String()); // TEST HTML
20
		html.put(NON_TEST, new String()); // HTML
21
		json.put(TEST, new String()); // TEST JSON
22
		json.put(NON_TEST, new String()); // JSON
23
	}
24
	
25
	public void setData(String html, String json, boolean testing) {
26
		this.html.put(testing, html.trim());
27
		this.json.put(testing, json.trim());
28
	}
29
	
30
	public String getHtml() {
31
		return html.get(NON_TEST);
32
	}
33
	
34
	public String getJson() {
35
		return json.get(NON_TEST);
36
	}
37
	
38
	public void merge() {
39
		html.put(NON_TEST, html.get(TEST));
40
		json.put(NON_TEST, html.get(TEST));
41
	}
42
	
43
	public boolean contains(boolean testing) {
44
		String html = this.html.get(testing);
45
		String json = this.json.get(testing);
46
		return /*html != null && */html.length() > 0 &&/* json != null && */json.length() > 0;
47
	}
48
	
49
}
(7-7/7)