public final class Primitive extends Object
Copyright (c) 2002-2009 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved.
See for project information www.simulation.tudelft.nl.
The DSOL project is distributed under the following BSD-style license:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:
Modifier and Type | Method and Description |
---|---|
static Object[] |
cast(Class<?>[] classes,
Object[] values)
casts a set of values to classes.
|
static Object |
cast(Class<?> clazz,
Object object)
casts an object to a instance of clazz.
|
static Class<?> |
forName(String className)
returns the primitiveClass of the name given as defined by the Java VM class constants.
|
static Class<?> |
getPrimitive(Class<?> wrapperClass)
gets the primitive of the given wrapperClass.
|
static Class<?> |
getWrapper(Class<?> primitiveClass)
gets the wrapper of this primitive class.
|
static Boolean |
toBoolean(Object object)
casts an object to Boolean.
|
static Byte |
toByte(Object object)
casts an object to Byte.
|
static Character |
toCharacter(Object object)
casts an object to Character.
|
static Double |
toDouble(Object object)
casts an object to Double.
|
static Float |
toFloat(Object object)
casts an object to Float.
|
static Integer |
toInteger(Object object)
casts an object to Integer.
|
static Long |
toLong(Object object)
casts an object to Long.
|
static Short |
toShort(Object object)
casts an object to Short.
|
public static Object[] cast(Class<?>[] classes, Object[] values)
classes
- the classes to cast tovalues
- the valuespublic static Object cast(Class<?> clazz, Object object)
clazz
- the class to cast toobject
- the object to castpublic static Class<?> forName(String className)
className
- the classNamepublic static Class<?> getPrimitive(Class<?> wrapperClass)
wrapperClass
- the wrapper classpublic static Class<?> getWrapper(Class<?> primitiveClass)
primitiveClass
- the primitive classpublic static Boolean toBoolean(Object object)
object
- the objectpublic static Byte toByte(Object object)
object
- the objectpublic static Character toCharacter(Object object)
object
- the object to parsepublic static Double toDouble(Object object)
object
- the object to parsepublic static Float toFloat(Object object)
object
- the object to parsepublic static Long toLong(Object object)
object
- the object to parsepublic static Short toShort(Object object)
object
- the object to parseCopyright © 2015–2019 Delft University of Technology. All rights reserved.