You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/06/27 14:41:43 UTC

[commons-text] 01/09: Sort members.

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

commit 06a4648e2432d0e17cca48dbac47a38e49fac3b6
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jun 27 09:36:58 2020 -0400

    Sort members.
---
 .../commons/text/lookup/StringLookupFactory.java   | 66 +++++++++++-----------
 1 file changed, 33 insertions(+), 33 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 b083ee7..0eaa045 100644
--- a/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
+++ b/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
@@ -448,6 +448,39 @@ public final class StringLookupFactory {
     }
 
     /**
+     * Returns the DnsStringLookup singleton instance where the lookup key is one of:
+     * <ul>
+     * <li><b>name</b>: for the local host name, for example {@code EXAMPLE} but also {@code EXAMPLE.apache.org}.</li>
+     * <li><b>canonical-name</b>: for the local canonical host name, for example {@code EXAMPLE.apache.org}.</li>
+     * <li><b>address</b>: for the local host address, for example {@code 192.168.56.1}.</li>
+     * </ul>
+     *
+     * <p>
+     * Using a {@link StringLookup} from the {@link StringLookupFactory}:
+     * </p>
+     *
+     * <pre>
+     * StringLookupFactory.INSTANCE.dnsStringLookup().lookup("address|apache.org");
+     * </pre>
+     * <p>
+     * Using a {@link StringSubstitutor}:
+     * </p>
+     *
+     * <pre>
+     * StringSubstitutor.createInterpolator().replace("... ${dns:address|apache.org} ..."));
+     * </pre>
+     * <p>
+     * The above examples convert {@code "address|apache.org"} to {@code "95.216.24.32} (or {@code "40.79.78.1"}).
+     * </p>
+     *
+     * @return the DateStringLookup singleton instance.
+     * @since 1.8
+     */
+    public StringLookup dnsStringLookup() {
+        return DnsStringLookup.INSTANCE;
+    }
+
+    /**
      * Returns the EnvironmentVariableStringLookup singleton instance where the lookup key is an environment variable
      * name.
      * <p>
@@ -644,39 +677,6 @@ public final class StringLookupFactory {
     }
 
     /**
-     * Returns the DnsStringLookup singleton instance where the lookup key is one of:
-     * <ul>
-     * <li><b>name</b>: for the local host name, for example {@code EXAMPLE} but also {@code EXAMPLE.apache.org}.</li>
-     * <li><b>canonical-name</b>: for the local canonical host name, for example {@code EXAMPLE.apache.org}.</li>
-     * <li><b>address</b>: for the local host address, for example {@code 192.168.56.1}.</li>
-     * </ul>
-     *
-     * <p>
-     * Using a {@link StringLookup} from the {@link StringLookupFactory}:
-     * </p>
-     *
-     * <pre>
-     * StringLookupFactory.INSTANCE.dnsStringLookup().lookup("address|apache.org");
-     * </pre>
-     * <p>
-     * Using a {@link StringSubstitutor}:
-     * </p>
-     *
-     * <pre>
-     * StringSubstitutor.createInterpolator().replace("... ${dns:address|apache.org} ..."));
-     * </pre>
-     * <p>
-     * The above examples convert {@code "address|apache.org"} to {@code "95.216.24.32} (or {@code "40.79.78.1"}).
-     * </p>
-     *
-     * @return the DateStringLookup singleton instance.
-     * @since 1.8
-     */
-    public StringLookup dnsStringLookup() {
-        return DnsStringLookup.INSTANCE;
-    }
-
-    /**
      * Returns a new map-based lookup where the request for a lookup is answered with the value for that key.
      *
      * @param <V> the map value type.