public static boolean requiredBoolean ( JSONObject o , String id ) throws JSONConverterException { checkKeys ( o , id ) ; Object x = o . get ( id ) ; if ( ! ( x instanceof Boolean ) ) { throw new JSONConverterException ( "Boolean expected at key '" + id + "' but was '" + x . getClass ( ) + "'." ) ; } return ( Boolean ) x ; }
Read an expected boolean .