-
Notifications
You must be signed in to change notification settings - Fork 13
/
EntryStub.java
108 lines (96 loc) · 2.96 KB
/
EntryStub.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
/**********************************************************************
* Copyright (c) 2020 École Polytechnique de Montréal
*
* 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
**********************************************************************/
package org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A Stub class for the entry elements. It matches the trace server protocol's
* <code>Entry</code> schema
*
* @author Geneviève Bastien
*/
public class EntryStub implements Serializable {
private static final long serialVersionUID = 3428838268294534414L;
private final List<String> fLabels;
private final int fId;
private final int fParentId;
private final boolean fHasRowModel;
private final OutputElementStyleStub fStyle;
/**
* {@link JsonCreator} Constructor for final fields
*
* @param labels
* The labels of this entry
* @param id
* The unique ID of the entry
* @param parentId
* The unique id of the parent of this entry
* @param hasRowModel
* Whether this entry has data
* @param style
* The style of this entry
*/
@JsonCreator
public EntryStub(@JsonProperty("labels") List<String> labels,
@JsonProperty("id") Integer id,
@JsonProperty("parentId") Integer parentId,
@JsonProperty("hasData") boolean hasRowModel,
@JsonProperty("style") OutputElementStyleStub style) {
fLabels = Objects.requireNonNull(labels, "The 'labels' json field was not set");
fId = Objects.requireNonNull(id, "The 'id' json field was not set");
fParentId = parentId;
fHasRowModel = hasRowModel;
fStyle = style;
}
/**
* Get the labels of this entry
*
* @return The labels of the entry
*/
public List<String> getLabels() {
return fLabels;
}
/**
* Get the ID of this entry
*
* @return The ID of the entry
*/
public int getId() {
return fId;
}
/**
* Get the parent ID of the entry
*
* @return The parent ID
*/
public int getParentId() {
return fParentId;
}
/**
* Get whether this entry has row models
*
* @return Whether the entry has row model
*/
public boolean hasRowModel() {
return fHasRowModel;
}
/**
* Get the style for this entry
*
* @return The entry's style
*/
public OutputElementStyleStub getStyle() {
return fStyle;
}
}