Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
TapElement |
|
| 1.0;1 |
1 | /* | |
2 | * The MIT License | |
3 | * | |
4 | * Copyright (c) 2010 tap4j team (see AUTHORS) | |
5 | * | |
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
7 | * of this software and associated documentation files (the "Software"), to deal | |
8 | * in the Software without restriction, including without limitation the rights | |
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
10 | * copies of the Software, and to permit persons to whom the Software is | |
11 | * furnished to do so, subject to the following conditions: | |
12 | * | |
13 | * The above copyright notice and this permission notice shall be included in | |
14 | * all copies or substantial portions of the Software. | |
15 | * | |
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
22 | * THE SOFTWARE. | |
23 | */ | |
24 | package org.tap4j.model; | |
25 | ||
26 | import java.io.Serializable; | |
27 | import java.util.LinkedHashMap; | |
28 | import java.util.Map; | |
29 | ||
30 | /** | |
31 | * A TAP element. | |
32 | * | |
33 | * @since 1.0 | |
34 | */ | |
35 | 10 | public class TapElement implements Serializable { |
36 | ||
37 | /** | |
38 | * Serial Version UID. | |
39 | */ | |
40 | private static final long serialVersionUID = 9108597596777603763L; | |
41 | ||
42 | /** | |
43 | * Input line indentation. | |
44 | */ | |
45 | protected int indentation; | |
46 | ||
47 | /** | |
48 | * Iterable object returned by SnakeYAML. | |
49 | */ | |
50 | 10 | private Map<String, Object> diagnostic = new LinkedHashMap<String, Object>(); |
51 | ||
52 | /** | |
53 | * Comment. | |
54 | */ | |
55 | protected Comment comment; | |
56 | ||
57 | /** | |
58 | * Get the indentation of the corresponding input line. | |
59 | * | |
60 | * @return Indentation in the original stream | |
61 | */ | |
62 | public int getIndentation() { | |
63 | 0 | return indentation; |
64 | } | |
65 | ||
66 | /** | |
67 | * YAML diagnostic information. | |
68 | * @return the YAML diagnostic as a map | |
69 | */ | |
70 | public Map<String, Object> getDiagnostic() { | |
71 | 1 | return this.diagnostic; |
72 | } | |
73 | ||
74 | /** | |
75 | * YAML diagnostic information setter. | |
76 | * @param diagnostic TAP element YAML diagnostic map | |
77 | */ | |
78 | public void setDiagnostic(Map<String, Object> diagnostic) { | |
79 | 0 | this.diagnostic = diagnostic; |
80 | 0 | } |
81 | ||
82 | /** | |
83 | * @param comment Comment. | |
84 | */ | |
85 | public void setComment(Comment comment) { | |
86 | 3 | this.comment = comment; |
87 | 3 | } |
88 | ||
89 | /** | |
90 | * @return Comment. | |
91 | */ | |
92 | public Comment getComment() { | |
93 | 4 | return this.comment; |
94 | } | |
95 | } |