7f28dc8be5a0a66246054456061429c3aef46620
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng / src / org / eclipse / linuxtools / lttng / event / LttngEventField.java
1 /*******************************************************************************
2 * Copyright (c) 2009 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 * William Bourque (wbourque@gmail.com) - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.lttng.event;
14
15 import org.eclipse.linuxtools.tmf.event.TmfEventField;
16
17 /**
18 * <b><u>LttngEventField</u></b><p>
19 *
20 * Lttng specific implementation of the TmfEventField.<p>
21 *
22 * LttngEventField add a "name" attribute to the Tmf implementation This
23 * mean the fields will have a name and a value.
24 */
25 public class LttngEventField extends TmfEventField {
26 private String fieldName = "";
27
28 /**
29 * Constructor with parameters.<p>
30 *
31 * @param name Name of the field
32 * @param newContent ParsedContent we want to populate the field with.
33 *
34 * @see org.eclipse.linuxtools.lttng.jni.JniParser
35 */
36 public LttngEventField(String name, Object newContent) {
37 super(newContent);
38
39 fieldName = name;
40 }
41
42 /**
43 * Copy constructor.<p>
44 *
45 * @param oldField the field to copy from
46 */
47 public LttngEventField(LttngEventField oldField) {
48 this(oldField.fieldName, oldField.getValue());
49 }
50
51
52 public String getName() {
53 return fieldName;
54 }
55
56 /**
57 * toString() method.<p>
58 *
59 * Print both field name and value (i.e. NAME:VALUE ).
60 */
61 @Override
62 public String toString() {
63 return fieldName + ":" + getValue().toString();
64 }
65 }
This page took 0.037106 seconds and 4 git commands to generate.