-
Notifications
You must be signed in to change notification settings - Fork 9
/
XyModelStub.java
65 lines (57 loc) · 1.95 KB
/
XyModelStub.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
/**********************************************************************
* 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.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A Stub class for the entry model. It matches the trace server protocol's
* <code>XYModel</code> schema
*
* @author Geneviève Bastien
*/
public class XyModelStub implements Serializable {
private static final long serialVersionUID = 6027193074532379770L;
private final Set<XySeriesStub> fSeries;
private final String fTitle;
/**
* {@link JsonCreator} Constructor for final fields
*
* @param series
* The set of series for this model
* @param title
* The title of this model
*/
@JsonCreator
public XyModelStub(@JsonProperty("series") Set<XySeriesStub> series,
@JsonProperty("title") String title) {
fSeries = Objects.requireNonNull(series, "The 'series' json field was not set");
fTitle = Objects.requireNonNull(title, "The 'title' json field was not set");
}
/**
* Get the series described by this model
*
* @return The series in this model
*/
public Set<XySeriesStub> getSeries() {
return fSeries;
}
/**
* Get the title that describe this model
*
* @return The title of this model
*/
public String getTitle() {
return fTitle;
}
}