This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-text.git
The following commit(s) were added to refs/heads/master by this push: new c9aa25e Sort members. c9aa25e is described below commit c9aa25e6be325697f7c83cef7a859a6e908b710a Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sat Jun 27 10:54:04 2020 -0400 Sort members. --- .../commons/text/lookup/StringLookupFactory.java | 94 +++++++++++----------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java b/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java index dec504f..e0870da 100644 --- a/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java +++ b/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java @@ -151,6 +151,53 @@ public final class StringLookupFactory { public static final StringLookupFactory INSTANCE = new StringLookupFactory(); /** + * Decodes Base64 Strings. + * <p> + * Using a {@link StringLookup} from the {@link StringLookupFactory}: + * </p> + * + * <pre> + * StringLookupFactory.INSTANCE.base64DecoderStringLookup().lookup("SGVsbG9Xb3JsZCE="); + * </pre> + * <p> + * Using a {@link StringSubstitutor}: + * </p> + * + * <pre> + * StringSubstitutor.createInterpolator().replace("... ${base64Decoder:SGVsbG9Xb3JsZCE=} ...")); + * </pre> + * <p> + * The above examples convert {@code "SGVsbG9Xb3JsZCE="} to {@code "HelloWorld!"}. + * </p> + */ + static final FunctionStringLookup<String> INSTANCE_BASE64_DECODER = FunctionStringLookup + .on(key -> new String(Base64.getDecoder().decode(key), StandardCharsets.ISO_8859_1)); + + /** + * Encodes Base64 Strings. + * <p> + * Using a {@link StringLookup} from the {@link StringLookupFactory}: + * </p> + * + * <pre> + * StringLookupFactory.INSTANCE.base64EncoderStringLookup().lookup("HelloWorld!"); + * </pre> + * <p> + * Using a {@link StringSubstitutor}: + * </p> + * + * <pre> + * StringSubstitutor.createInterpolator().replace("... ${base64Encoder:HelloWorld!} ...")); + * </pre> + * <p> + * The above examples convert {@code "HelloWorld!"} to {@code "SGVsbG9Xb3JsZCE="}. + * </p> + * Defines the singleton for this class. + */ + static final FunctionStringLookup<String> INSTANCE_BASE64_ENCODER = FunctionStringLookup + .on(key -> Base64.getEncoder().encodeToString(key.getBytes(StandardCharsets.ISO_8859_1))); + + /** * Looks up keys from environment variables. * <p> * Using a {@link StringLookup} from the {@link StringLookupFactory}: @@ -314,53 +361,6 @@ public final class StringLookupFactory { } /** - * Encodes Base64 Strings. - * <p> - * Using a {@link StringLookup} from the {@link StringLookupFactory}: - * </p> - * - * <pre> - * StringLookupFactory.INSTANCE.base64EncoderStringLookup().lookup("HelloWorld!"); - * </pre> - * <p> - * Using a {@link StringSubstitutor}: - * </p> - * - * <pre> - * StringSubstitutor.createInterpolator().replace("... ${base64Encoder:HelloWorld!} ...")); - * </pre> - * <p> - * The above examples convert {@code "HelloWorld!"} to {@code "SGVsbG9Xb3JsZCE="}. - * </p> - * Defines the singleton for this class. - */ - static final FunctionStringLookup<String> INSTANCE_BASE64_ENCODER = FunctionStringLookup - .on(key -> Base64.getEncoder().encodeToString(key.getBytes(StandardCharsets.ISO_8859_1))); - - /** - * Decodes Base64 Strings. - * <p> - * Using a {@link StringLookup} from the {@link StringLookupFactory}: - * </p> - * - * <pre> - * StringLookupFactory.INSTANCE.base64DecoderStringLookup().lookup("SGVsbG9Xb3JsZCE="); - * </pre> - * <p> - * Using a {@link StringSubstitutor}: - * </p> - * - * <pre> - * StringSubstitutor.createInterpolator().replace("... ${base64Decoder:SGVsbG9Xb3JsZCE=} ...")); - * </pre> - * <p> - * The above examples convert {@code "SGVsbG9Xb3JsZCE="} to {@code "HelloWorld!"}. - * </p> - */ - static final FunctionStringLookup<String> INSTANCE_BASE64_DECODER = FunctionStringLookup - .on(key -> new String(Base64.getDecoder().decode(key), StandardCharsets.ISO_8859_1)); - - /** * No need to build instances for now. */ private StringLookupFactory() {