ctf: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / org.eclipse.tracecompass.lttng2.control.core / src / org / eclipse / tracecompass / internal / lttng2 / control / core / model / impl / FieldInfo.java
CommitLineData
d4514365 1/**********************************************************************
ed902a2b 2 * Copyright (c) 2012, 2014 Ericsson
d4514365
BH
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 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
9bc60be7 12package org.eclipse.tracecompass.internal.lttng2.control.core.model.impl;
d4514365 13
9bc60be7 14import org.eclipse.tracecompass.internal.lttng2.control.core.model.IFieldInfo;
d4514365
BH
15
16/**
17* <p>
18* Implementation of the basic trace event interface (IEventInfo) to store event
19* related data.
20* </p>
21*
22* @author Bernd Hufmann
23*/
24public class FieldInfo extends TraceInfo implements IFieldInfo {
25
26 // ------------------------------------------------------------------------
27 // Attributes
28 // ------------------------------------------------------------------------
29 /**
30 * The trace event type.
31 */
32 private String fFieldType;
33
34 // ------------------------------------------------------------------------
35 // Constructors
36 // ------------------------------------------------------------------------
37 /**
38 * Constructor
39 * @param name - name of base event
40 */
41 public FieldInfo(String name) {
42 super(name);
43 }
44
45 /**
46 * Copy constructor
47 * @param other - the instance to copy
48 */
49 public FieldInfo(FieldInfo other) {
50 super(other);
51 fFieldType = other.fFieldType;
52 }
53
54 // ------------------------------------------------------------------------
55 // Accessors
56 // ------------------------------------------------------------------------
57
d4514365
BH
58 @Override
59 public String getFieldType() {
60 return fFieldType;
61 }
62
d4514365
BH
63 @Override
64 public void setFieldType(String fieldType) {
e5e5b3db 65 fFieldType = fieldType.toLowerCase();
d4514365
BH
66 }
67
d4514365
BH
68 @Override
69 public int hashCode() {
70 final int prime = 31;
71 int result = super.hashCode();
72 result = prime * result
73 + ((fFieldType == null) ? 0 : fFieldType.hashCode());
74 return result;
75 }
76
d4514365
BH
77 @Override
78 public boolean equals(Object obj) {
79 if (this == obj) {
80 return true;
81 }
82 if (!super.equals(obj)) {
83 return false;
84 }
85 if (getClass() != obj.getClass()) {
86 return false;
87 }
88 FieldInfo other = (FieldInfo) obj;
89 if (fFieldType == null) {
90 if (other.fFieldType != null) {
91 return false;
92 }
93 } else if (!fFieldType.equals(other.fFieldType)) {
94 return false;
95 }
96 return true;
97 }
98
d4514365
BH
99 @SuppressWarnings("nls")
100 @Override
101 public String toString() {
102 StringBuffer output = new StringBuffer();
103 output.append("[FieldInfo(");
104 output.append(super.toString());
105 output.append(",type=");
106 output.append(fFieldType);
107 return output.toString();
108 }
109}
This page took 0.065008 seconds and 5 git commands to generate.