@ Pure public String getDefaultValueForType ( String type ) { //TODO: Check if a similar function exists in the Xbase library. String defaultValue = "" ; if ( ! Strings . isEmpty ( type ) && ! "void" . equals ( type ) ) { switch ( type ) { case "boolean" : defaultValue = "true" ; break ; case "double" : defaultValue = "0.0" ; break ; case "float" : defaultValue = "0.0f" ; break ; case "int" : defaultValue = "0" ; break ; case "long" : defaultValue = "0" ; break ; case "byte" : defaultValue = "(0 as byte)" ; break ; case "short" : defaultValue = "(0 as short)" ; break ; case "char" : defaultValue = "(0 as char)" ; break ; default : defaultValue = "null" ; break ; } } return defaultValue ; }
Replies the default value for the given type .