-
Notifications
You must be signed in to change notification settings - Fork 12
/
JsonEventRecordMetadataNode.java
124 lines (112 loc) · 3.38 KB
/
JsonEventRecordMetadataNode.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*******************************************************************************
* Copyright (c) 2023 Ericsson
*
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Sehr Moosabhoy - Initial implementation
*******************************************************************************/
package org.eclipse.tracecompass.internal.ctf.core.event.metadata;
import org.eclipse.tracecompass.ctf.core.CTFException;
import org.eclipse.tracecompass.internal.ctf.core.event.types.ICTFMetadataNode;
import com.google.gson.annotations.SerializedName;
/**
* Node to store the event record fragment of JSON Metadata for CTF2 traces
*
* @author Sehr Moosabhoy
*
*/
public class JsonEventRecordMetadataNode extends CTFJsonMetadataNode {
@SerializedName("id")
private int fId;
@SerializedName("data-stream-class-id")
private int fDataStreamClassId;
@SerializedName("name")
private String fName;
@SerializedName("namespace")
private String fNamespace;
@SerializedName("specific-context-field-class")
private JsonStructureFieldMetadataNode fSpecificContextClass;
@SerializedName("payload-field-class")
private JsonStructureFieldMetadataNode fPayloadFieldClass;
/**
* Constructor for a JsonEventRecordMetadataNode
*
* @param parent
* the parent of the new node
* @param type
* the type of the new node
* @param value
* the value of the new node
*/
public JsonEventRecordMetadataNode(ICTFMetadataNode parent, String type, String value) {
super(parent, type, value);
}
/**
* Get the namespace of the event record
*
* @return the namespace
*/
public String getNamespace() {
return fNamespace;
}
/**
* Get the name of the event record
*
* @return the name
*/
public String getName() {
return fName;
}
/**
* Get the id of the event record
*
* @return the id
*/
public int getId() {
return fId;
}
/**
* Get the data stream class id of the event record
*
* @return the data stream class id
*/
public int getDataStreamClassId() {
return fDataStreamClassId;
}
/**
* Get the specific context class of the event record
*
* @return the specific context class
*/
public JsonStructureFieldMetadataNode getSpecificContextClass() {
return fSpecificContextClass;
}
/**
* Get the payload field class of the event record
*
* @return the payload field class
*/
public JsonStructureFieldMetadataNode getPayloadFieldClass() {
return fPayloadFieldClass;
}
@Override
public void initialize() throws CTFException {
super.initialize();
if (fSpecificContextClass != null) {
fSpecificContextClass.initialize();
addChild(fSpecificContextClass);
fSpecificContextClass.setParent(this);
}
if (fPayloadFieldClass != null) {
fPayloadFieldClass.initialize();
addChild(fPayloadFieldClass);
fPayloadFieldClass.setParent(this);
}
}
}