@Test public void testEncodeObjects() throws Exception { final QCodec qcodec = new QCodec(); final String plain = "1+1 = 2"; final String encoded = (String) qcodec.encode((Object) plain); assertEquals("Basic Q encoding test", "=?UTF-8?Q?1+1 =3D 2?=", encoded); final Object result = qcodec.encode((Object) null); assertEquals( "Encoding a null Object should return null", null, result); try { final Object dObj = new Double(3.0); qcodec.encode( dObj ); fail( "Trying to url encode a Double object should cause an exception."); } catch (final EncoderException ee) { } }
public String encode(final String str, final Charset charset) throws EncoderException { if (str == null) { return null; } return encodeText(str, charset); }
QCodec extends RFC1522Codec implements StringEncoder, StringDecoder { public String encode(final String str, final Charset charset) throws EncoderException { if (str == null) { return null; } return encodeText(str, charset); } }
QCodec extends RFC1522Codec implements StringEncoder, StringDecoder { public String encode(final String str, final Charset charset) throws EncoderException { if (str == null) { return null; } return encodeText(str, charset); } QCodec();  QCodec(final Charset charset);  QCodec(final String charsetName); }
QCodec extends RFC1522Codec implements StringEncoder, StringDecoder { public String encode(final String str, final Charset charset) throws EncoderException { if (str == null) { return null; } return encodeText(str, charset); } QCodec();  QCodec(final Charset charset);  QCodec(final String charsetName); String encode(final String str, final Charset charset); String encode(final String str, final String charset); @Override String encode(final String str); @Override String decode(final String str); @Override Object encode(final Object obj); @Override Object decode(final Object obj); Charset getCharset(); String getDefaultCharset(); boolean isEncodeBlanks(); void setEncodeBlanks(final boolean b); }
QCodec extends RFC1522Codec implements StringEncoder, StringDecoder { public String encode(final String str, final Charset charset) throws EncoderException { if (str == null) { return null; } return encodeText(str, charset); } QCodec();  QCodec(final Charset charset);  QCodec(final String charsetName); String encode(final String str, final Charset charset); String encode(final String str, final String charset); @Override String encode(final String str); @Override String decode(final String str); @Override Object encode(final Object obj); @Override Object decode(final Object obj); Charset getCharset(); String getDefaultCharset(); boolean isEncodeBlanks(); void setEncodeBlanks(final boolean b);  }