protected Object primitive ( Type type ) { Class < ? > rawType = Types . getRawType ( type ) ; if ( rawType . equals ( Boolean . TYPE ) ) { return ( boolean ) false ; } else if ( rawType . equals ( Character . TYPE ) ) { return ( char ) 0 ; } else if ( rawType . equals ( Byte . TYPE ) ) { return ( byte ) 0 ; } else if ( rawType . equals ( Double . TYPE ) ) { return ( double ) 0.0 ; } else if ( rawType . equals ( Float . TYPE ) ) { return ( float ) 0.0 ; } else if ( rawType . equals ( Integer . TYPE ) ) { return ( int ) 0 ; } else { // short. return ( short ) 0 ; } }
Returns the default value of the specified primitive type .