|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectPrimitiveTypes
public final class PrimitiveTypes extends Object
| Modifier and Type | Field and Description |
|---|---|
static Map<Class<?>,Boolean> |
isPrimitiveCached
|
protected static Map<String,Class<?>> |
typeNameToPrimitiveOrString
|
| Modifier and Type | Method and Description |
|---|---|
static Class<?> |
boxedType(Class<?> c1)
|
static Class<?> |
getBoxedType(String typeName)
|
static Set<Class<?>> |
getBoxedTypesAndString()
|
static Class<?> |
getPrimitiveTypeOrString(String typeName)
|
static Set<Class<?>> |
getPrimitiveTypesAndString()
|
static Class<?> |
getUnboxType(Class<?> c)
|
static boolean |
isBoxedOrPrimitiveOrStringType(Class<?> c)
|
static boolean |
isBoxedPrimitiveTypeOrString(Class<?> c)
|
static boolean |
isPrimitive(Class<?> c)
Same as c.isPrimitive() but faster if this test is done very frequently (as it is in Randoop). |
static boolean |
isPrimitiveOrStringType(Class<?> type)
|
static boolean |
isPrimitiveOrStringTypeName(String typeName)
|
static boolean |
looksLikeObjectToString(String s)
Returns true if the given string looks like it came from a call of Object.toString(); in other words, looks something like " |
static Class<?> |
primitiveType(Class<? extends Object> c)
Returns null if c is not a primitive or a boxed type. |
static boolean |
stringLengthOK(String s)
Returns true if the given string is deemed to be reasonable (i.e. |
static String |
toCodeString(Object value)
Given a primitive, boxed primitive, or String, returns a String that can be uesd in Java source to represent it. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Map<String,Class<?>> typeNameToPrimitiveOrString
public static Map<Class<?>,Boolean> isPrimitiveCached
| Method Detail |
|---|
public static boolean isPrimitiveOrStringTypeName(String typeName)
public static Class<?> getBoxedType(String typeName)
public static Class<?> getPrimitiveTypeOrString(String typeName)
public static Set<Class<?>> getPrimitiveTypesAndString()
public static Set<Class<?>> getBoxedTypesAndString()
public static Class<?> boxedType(Class<?> c1)
public static boolean isBoxedPrimitiveTypeOrString(Class<?> c)
public static boolean isPrimitiveOrStringType(Class<?> type)
public static boolean isPrimitive(Class<?> c)
public static boolean isBoxedOrPrimitiveOrStringType(Class<?> c)
public static Class<?> primitiveType(Class<? extends Object> c)
public static String toCodeString(Object value)
value - the value to create a String representation for.
The value's type must be a primitive type, a String, or null.public static Class<?> getUnboxType(Class<?> c)
public static boolean looksLikeObjectToString(String s)
public static boolean stringLengthOK(String s)
If Randoop generates tests using strings that are too long, this can result in non-compilable tests due to the JVM's limit on the length of a string.
A string S is too long if, when printed as code in a generated unit test, it may result in a non-compilable test. In order to determine this, we have to consider not the length of s, but the length of the string that would be printed to obtain s, which may be different due to escaped and unicode characters. This method takes this into account.
GenInputsAbstract
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||