@ SuppressWarnings ( { "checkstyle:cyclomaticcomplexity" , "checkstyle:booleanexpressioncomplexity" , "checkstyle:npathcomplexity" } ) public static String toDefaultValue ( JvmTypeReference type ) { final String id = type . getIdentifier ( ) ; if ( ! "void" . equals ( id ) ) { //$NON-NLS-1$ if ( Strings . equal ( Boolean . class . getName ( ) , id ) || Strings . equal ( Boolean . TYPE . getName ( ) , id ) ) { return "False" ; //$NON-NLS-1$ } if ( Strings . equal ( Float . class . getName ( ) , id ) || Strings . equal ( Float . TYPE . getName ( ) , id ) || Strings . equal ( Double . class . getName ( ) , id ) || Strings . equal ( Double . TYPE . getName ( ) , id ) ) { return "0.0" ; //$NON-NLS-1$ } if ( Strings . equal ( Integer . class . getName ( ) , id ) || Strings . equal ( Integer . TYPE . getName ( ) , id ) || Strings . equal ( Long . class . getName ( ) , id ) || Strings . equal ( Long . TYPE . getName ( ) , id ) || Strings . equal ( Byte . class . getName ( ) , id ) || Strings . equal ( Byte . TYPE . getName ( ) , id ) || Strings . equal ( Short . class . getName ( ) , id ) || Strings . equal ( Short . TYPE . getName ( ) , id ) ) { return "0" ; //$NON-NLS-1$ } if ( Strings . equal ( Character . class . getName ( ) , id ) || Strings . equal ( Character . TYPE . getName ( ) , id ) ) { return "\"\\0\"" ; //$NON-NLS-1$ } } return "None" ; //$NON-NLS-1$ }
Replies the Python default value for the given type .