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