pcap.core: making some classes final
[deliverable/tracecompass.git] / pcap / org.eclipse.tracecompass.tmf.pcap.core / src / org / eclipse / tracecompass / internal / tmf / pcap / core / event / aspect / PcapReferenceAspect.java
CommitLineData
b04903a2 1/*******************************************************************************
ed902a2b 2 * Copyright (c) 2014, 2015 Ericsson
b04903a2
AM
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 * Alexandre Montplaisir - Update to new ITmfEventAspect API
0214cc07 12 * Patrick Tasse - Make pcap aspects singletons
b04903a2
AM
13 *******************************************************************************/
14
15package org.eclipse.tracecompass.internal.tmf.pcap.core.event.aspect;
16
2a28075c 17import org.eclipse.jdt.annotation.Nullable;
b04903a2
AM
18import org.eclipse.tracecompass.internal.tmf.pcap.core.event.PcapEvent;
19import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
20import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
21
22/**
23 * The "packet reference" aspect for pcap events
24 *
25 * @author Alexandre Montplaisir
26 */
1ad849b8 27public final class PcapReferenceAspect implements ITmfEventAspect<String> {
b04903a2 28
0214cc07
PT
29 /** Singleton instance */
30 public static final PcapReferenceAspect INSTANCE = new PcapReferenceAspect();
31
32 private PcapReferenceAspect() {
33 }
34
b04903a2
AM
35 @Override
36 public String getName() {
37 return Messages.getMessage(Messages.PcapAspectName_Reference);
38 }
39
40 @Override
41 public String getHelpText() {
42 return EMPTY_STRING;
43 }
44
45 @Override
2a28075c 46 public @Nullable String resolve(ITmfEvent event) {
b04903a2 47 if (!(event instanceof PcapEvent)) {
2a28075c 48 return null;
b04903a2
AM
49 }
50 return ((PcapEvent) event).getReference();
51 }
b04903a2 52}
This page took 0.051374 seconds and 5 git commands to generate.