Remove unneeded checkNotNull() calls
[deliverable/tracecompass.git] / gdbtrace / org.eclipse.tracecompass.gdbtrace.core / src / org / eclipse / tracecompass / internal / gdbtrace / core / trace / GdbEventAspects.java
CommitLineData
99d7adc6 1/*******************************************************************************
0fca9497 2 * Copyright (c) 2014, 2015 Ericsson
99d7adc6
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 * Alexandre Montplaisir - Initial API and implementation
0fca9497 11 * Bernd Hufmann - Add Content aspect
99d7adc6
AM
12 *******************************************************************************/
13
b04903a2 14package org.eclipse.tracecompass.internal.gdbtrace.core.trace;
99d7adc6
AM
15
16import org.eclipse.jdt.annotation.NonNull;
e1de2fd4 17import org.eclipse.tracecompass.internal.gdbtrace.core.event.GdbTraceEvent;
04c0d7d3 18import org.eclipse.tracecompass.internal.gdbtrace.core.event.GdbTraceEventContent;
2bdf0193 19import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
9447c7ee 20import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
40dfafb3 21import org.eclipse.tracecompass.tmf.core.event.aspect.TmfContentFieldAspect;
99d7adc6
AM
22
23import com.google.common.collect.ImmutableList;
24
25/**
26 * Event table column definition for GDB traces.
27 *
28 * @author Alexandre Montplaisir
29 */
b04903a2 30public final class GdbEventAspects {
99d7adc6 31
b04903a2 32 private GdbEventAspects() {}
99d7adc6 33
5db5a3a4 34 private static final @NonNull Iterable<ITmfEventAspect> GDB_ASPECTS =
0e4f957e 35 ImmutableList.of(
40dfafb3
PT
36 new TmfContentFieldAspect(GdbTraceEventContent.TRACE_FRAME, GdbTraceEventContent.TRACE_FRAME),
37 new TmfContentFieldAspect(GdbTraceEventContent.TRACEPOINT, GdbTraceEventContent.TRACEPOINT),
0fca9497
BH
38 new GdbFileAspect(),
39 ITmfEventAspect.BaseAspects.CONTENTS
0e4f957e 40 );
99d7adc6 41
9447c7ee 42 private static class GdbFileAspect implements ITmfEventAspect {
99d7adc6 43
9447c7ee
AM
44 @Override
45 public String getName() {
46 return "File"; //$NON-NLS-1$
47 }
48
49 @Override
50 public String getHelpText() {
51 return EMPTY_STRING;
99d7adc6
AM
52 }
53
54 @Override
9447c7ee 55 public String resolve(ITmfEvent event) {
e1de2fd4
AM
56 if (!(event instanceof GdbTraceEvent)) {
57 return EMPTY_STRING;
58 }
59 String ret = ((GdbTraceEvent) event).getReference();
99d7adc6
AM
60 return (ret == null ? EMPTY_STRING : ret);
61 }
99d7adc6
AM
62 }
63
b04903a2
AM
64 /**
65 * Get the event aspects specific to GDB traces.
66 *
67 * @return The set of aspects
68 */
8192209b 69 public static @NonNull Iterable<ITmfEventAspect> getAspects() {
b04903a2 70 return GDB_ASPECTS;
99d7adc6
AM
71 }
72}
This page took 0.059127 seconds and 5 git commands to generate.