tmf: Integration of the pcap parser within TMF
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.pcap.core / src / org / eclipse / linuxtools / tmf / pcap / core / event / PcapEventType.java
1 /*******************************************************************************
2 * Copyright (c) 2014 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Vincent Perot - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.pcap.core.event;
14
15 import org.eclipse.jdt.annotation.NonNull;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.eclipse.linuxtools.tmf.core.event.ITmfEventField;
18 import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
19
20 /**
21 * Class that represents the type of a PcapEvent.
22 *
23 * @author Vincent Perot
24 */
25 public class PcapEventType extends TmfEventType {
26
27 private static final String EMPTY_STRING = ""; //$NON-NLS-1$
28
29 /**
30 * The default Context ID for a PcapEvent
31 */
32 @SuppressWarnings("null")
33 public static final @NonNull String DEFAULT_PCAP_CONTEXT_ID = Messages.PcapEventType_DefaultContext == null ? EMPTY_STRING : Messages.PcapEventType_DefaultContext;
34
35 /**
36 * The default Pcap Type ID for a PcapEvent
37 */
38 @SuppressWarnings("null")
39 public static final @NonNull String DEFAULT_PCAP_TYPE_ID = Messages.PcapEventType_DefaultTypeID == null ? EMPTY_STRING : Messages.PcapEventType_DefaultTypeID;
40
41 /**
42 * Default constructor
43 */
44 public PcapEventType() {
45 this(DEFAULT_PCAP_TYPE_ID, null);
46 }
47
48 /**
49 * Full constructor
50 *
51 * @param typeId
52 * the type name
53 * @param root
54 * the root field
55 */
56 public PcapEventType(final String typeId, final @Nullable ITmfEventField root) {
57 super(DEFAULT_PCAP_CONTEXT_ID, typeId, root);
58 }
59
60 /**
61 * Copy constructor
62 *
63 * @param type
64 * the other type
65 */
66 public PcapEventType(final PcapEventType type) {
67 super(type);
68 }
69
70 @Override
71 public @Nullable String toString() {
72 return getName();
73 }
74
75 }
This page took 0.034421 seconds and 5 git commands to generate.