Commit | Line | Data |
---|---|---|
a52fde77 | 1 | /******************************************************************************* |
6dd46830 | 2 | * Copyright (c) 2012, 2014 Ericsson |
a52fde77 AM |
3 | * Copyright (c) 2010, 2011 École Polytechnique de Montréal |
4 | * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com> | |
063f0d27 | 5 | * |
a52fde77 AM |
6 | * All rights reserved. This program and the accompanying materials are |
7 | * made available under the terms of the Eclipse Public License v1.0 which | |
8 | * accompanies this distribution, and is available at | |
9 | * http://www.eclipse.org/legal/epl-v10.html | |
063f0d27 | 10 | * |
a52fde77 AM |
11 | *******************************************************************************/ |
12 | ||
e894a508 | 13 | package org.eclipse.tracecompass.statesystem.core.exceptions; |
a52fde77 AM |
14 | |
15 | /** | |
16 | * The StateValue is a wrapper around the different type of values that can be | |
17 | * used and stored in the state system and history. "Unboxing" the value means | |
18 | * retrieving the base type (int, String, etc.) inside it. | |
063f0d27 | 19 | * |
a52fde77 AM |
20 | * This exception is thrown if the user tries to unbox a StateValue with an |
21 | * incorrect type (for example, tries to read a String value as an Int). | |
063f0d27 | 22 | * |
6dd46830 AM |
23 | * To avoid it, always check for the state value's type before attempting to |
24 | * unbox it, via | |
e894a508 | 25 | * {@link org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue#getType()}. |
063f0d27 | 26 | * |
6dd46830 | 27 | * @author Alexandre Montplaisir |
a52fde77 | 28 | */ |
6dd46830 | 29 | public class StateValueTypeException extends RuntimeException { |
a52fde77 | 30 | |
a52fde77 AM |
31 | private static final long serialVersionUID = -4548793451746144513L; |
32 | ||
063f0d27 AM |
33 | /** |
34 | * Default constructor | |
35 | */ | |
a6817576 AM |
36 | public StateValueTypeException() { |
37 | super(); | |
38 | } | |
39 | ||
063f0d27 AM |
40 | /** |
41 | * Constructor with a message | |
42 | * | |
43 | * @param message | |
44 | * Message to attach to this exception | |
45 | */ | |
a6817576 AM |
46 | public StateValueTypeException(String message) { |
47 | super(message); | |
48 | } | |
64d15677 AM |
49 | |
50 | /** | |
51 | * Constructor with both a message and a cause. | |
52 | * | |
53 | * @param message | |
54 | * Message to attach to this exception | |
55 | * @param e | |
56 | * Cause of this exception | |
57 | */ | |
58 | public StateValueTypeException(String message, Throwable e) { | |
59 | super(message, e); | |
60 | } | |
a52fde77 | 61 | } |