Fix some null warnings
[deliverable/tracecompass.git] / pcap / org.eclipse.tracecompass.tmf.pcap.core / src / org / eclipse / tracecompass / internal / tmf / pcap / core / event / PcapEventField.java
CommitLineData
b6eb4dce
VP
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
2bdf0193 13package org.eclipse.tracecompass.internal.tmf.pcap.core.event;
b6eb4dce 14
71f2817f 15import org.eclipse.tracecompass.internal.pcap.core.packet.Packet;
2bdf0193
AM
16import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
17import org.eclipse.tracecompass.tmf.core.event.TmfEventField;
b6eb4dce
VP
18
19/**
20 * Class that represents a TMF Pcap Event Field. It is identical to a
21 * TmfEventField, except that it overrides the toString() method.
22 *
23 * @author Vincent Perot
24 */
25public class PcapEventField extends TmfEventField {
26
27 private final String fSummaryString;
28
29 /**
30 * Full constructor
31 *
32 * @param name
33 * The event field id.
34 * @param value
35 * The event field value.
36 * @param fields
37 * The list of subfields.
38 * @param packet
39 * The packet from which to take the fields from.
40 * @throws IllegalArgumentException
41 * If 'name' is null, or if 'fields' has duplicate field names.
42 */
aa353506 43 public PcapEventField(String name, Object value, ITmfEventField[] fields, Packet packet) {
b6eb4dce
VP
44 super(name, value, fields);
45 fSummaryString = packet.getLocalSummaryString();
46 }
47
48 /**
49 * Copy constructor
50 *
51 * @param field
52 * the other event field
53 */
54 public PcapEventField(final PcapEventField field) {
55 super(field);
56 fSummaryString = field.fSummaryString;
57 }
58
59 @Override
60 public String toString() {
61 return fSummaryString;
62 }
63}
This page took 0.08626 seconds and 5 git commands to generate.