private static String getSimpleTypeName ( TypeReference typ ) { final Map < String , String > mapFullTypeName = ImmutableMap . < String , String > builder ( ) . put ( "B" , "byte" ) . put ( "C" , "char" ) . put ( "D" , "double" ) . put ( "F" , "float" ) . put ( "I" , "int" ) . put ( "J" , "long" ) . put ( "S" , "short" ) . put ( "Z" , "boolean" ) . build ( ) ; if ( typ . isArrayType ( ) ) return "Array" ; String typName = typ . getName ( ) . toString ( ) ; if ( typName . startsWith ( "L" ) ) { typName = typName . split ( "<" ) [ 0 ] . substring ( 1 ) ; // handle generics typName = typName . substring ( typName . lastIndexOf ( ' ' ) + 1 ) ; // get unqualified name typName = typName . substring ( typName . lastIndexOf ( ' ' ) + 1 ) ; // handle inner classes } else { typName = mapFullTypeName . get ( typName ) ; } return typName ; }
Get simple unqualified type name .