@ SuppressWarnings ( "rawtypes" ) protected static boolean writeBasic ( Output out , Object basic ) { if ( basic == null ) { out . writeNull ( ) ; } else if ( basic instanceof Boolean ) { out . writeBoolean ( ( Boolean ) basic ) ; } else if ( basic instanceof Number ) { out . writeNumber ( ( Number ) basic ) ; } else if ( basic instanceof String ) { out . writeString ( ( String ) basic ) ; } else if ( basic instanceof Enum ) { out . writeString ( ( ( Enum ) basic ) . name ( ) ) ; } else if ( basic instanceof Date ) { out . writeDate ( ( Date ) basic ) ; } else { return false ; } return true ; }
Writes a primitive out as an object