question: public ByteMatrix encode ( String contents , int width , int height , Map < EncodeHintType , Object > hints ) throws WriterException { if ( contents == null || contents . length ( ) == 0 ) { throw new IllegalArgumentException ( "Found empty contents" ) ; } if ( width < 0 || height < 0 ) { throw new IllegalArgumentException ( "Requested dimensions are too small: " + width + 'x' + height ) ; } ErrorCorrectionLevel errorCorrectionLevel = ErrorCorrectionLevel . L ; if ( hints != null ) { ErrorCorrectionLevel requestedECLevel = ( ErrorCorrectionLevel ) hints . get ( EncodeHintType . ERROR_CORRECTION ) ; if ( requestedECLevel != null ) { errorCorrectionLevel = requestedECLevel ; } } QRCode code = new QRCode ( ) ; Encoder . encode ( contents , errorCorrectionLevel , hints , code ) ; return renderResult ( code , width , height ) ; }
target:  Encode a string into a QR code with dimensions width x height. Hints contains suggestions for error-correction level and version. The default error-correction level is L, the default version is the smallest version for which the contents will fit into the QR-code.