We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert the following code into builtins mapper 👍
import static java.nio.charset.StandardCharsets.UTF_8 ; import java.io.UnsupportedEncodingException ; import java.net.URLDecoder ; import java.net.URLEncoder ; import java.util.Base64 ; /** * @author spornda * */ public final class BuiltinsNetTransformations { public static final Function<String, byte[]> DECODE_BASE64 = t -> Base64.getDecoder().decode(t) ; public static final Function<String, String> DECODE_URL = t -> { if (null == t || "null".equals(t)) { return null ; } try { return URLDecoder.decode(t, UTF_8.name()) ; } catch (UnsupportedEncodingException e) { // Ça ne doit jamais arriver throw new IllegalStateException("The Character Encoding is not supported : " + t) ; } } ; public static final Function<byte[], String> ENCODE_BASE64 = t -> (null != t) ? Base64.getEncoder().encodeToString(t) : "" ; public static final Function<String, String> ENCODE_URL = t -> { if (t == null) { return t ; } try { return URLEncoder.encode(t, UTF_8.name()) ; } catch (UnsupportedEncodingException e) { // Ça ne doit jamais arriver throw new IllegalStateException("The Character Encoding is not supported : " + t) ; } } ; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Convert the following code into builtins mapper 👍
The text was updated successfully, but these errors were encountered: