Here you can find the source of classNameToWrapperName(String ClassName)
Parameter | Description |
---|---|
in | non-null class |
public static String classNameToWrapperName(String ClassName)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w . j a v a2s. c o m * { field * * @name gPrimativeTypes * @function names of java primative types * } */ protected static final String gPrimativeTypes[] = { "int", "float", "boolean", "double", "byte", "char", "short", "long" }; /** * { field * * @name gWrapperTypes * @function list of java wrapper classes corresponding to primative types * } */ protected static final String gWrapperTypes[] = { "Integer", "Float", "Boolean", "Double", "Byte", "Character", "Integer", "Long" }; /** * convert the input class to a wrapper class * returns in if the argument is not primitive * * @param in non-null class * @return non-null class guaranteed not to be primitive */ public static String classNameToWrapperName(String ClassName) { for (int i = 0; i < gPrimativeTypes.length; i++) { if (ClassName.equals(gPrimativeTypes[i])) { return (gWrapperTypes[i]); } } return (ClassName); } }