public class PrimitiveUtil
extends java.lang.Object
IValue
to primitive values, if they are primitive. Additionally to usual primitives,
Strings and boxed primitives are also considered primitives here. This class has several utility methods to
allow converting those to primitive values as well.Constructor and Description |
---|
PrimitiveUtil() |
Modifier and Type | Method and Description |
---|---|
static PrimitiveValue |
getPrimitiveValue(long id,
ModelFactory factory,
org.eclipse.debug.core.model.IValue value)
Converts the given ITvalue instance to a primitive value.
|
static boolean |
isBoxedPrimitive(org.eclipse.debug.core.model.IValue value)
Returns whether the given value is a boxed primitive such as an Integer or Boolean object in Java.
|
static boolean |
isPrimitive(org.eclipse.debug.core.model.IValue value)
Returns whether the given IValue instance is a primitive value.
|
public static boolean isPrimitive(org.eclipse.debug.core.model.IValue value) throws org.eclipse.debug.core.DebugException
value
- The value to check if it is primitive.org.eclipse.debug.core.DebugException
- If any IValue method throws a DebugException.public static PrimitiveValue getPrimitiveValue(long id, ModelFactory factory, org.eclipse.debug.core.model.IValue value) throws org.eclipse.debug.core.DebugException
isPrimitive(IValue)
.id
- The id to set for the primitive value.factory
- The factory to use for creating the primitive value.value
- The value to convert to a primitive value.org.eclipse.debug.core.DebugException
- If any IValue method throws a DebugException.java.lang.IllegalArgumentException
- If the given value is not a primitive.public static boolean isBoxedPrimitive(org.eclipse.debug.core.model.IValue value) throws org.eclipse.debug.core.DebugException
value
- The value to check.org.eclipse.debug.core.DebugException
- If any IValue method throws a DebugException.