Package org.apache.commons.text.lookup
Class LocalHostStringLookup
java.lang.Object
org.apache.commons.text.lookup.AbstractStringLookup
org.apache.commons.text.lookup.LocalHostStringLookup
- All Implemented Interfaces:
StringLookup
Looks up keys related to the local host: host name, canonical host name, host address.
The lookup keys are:
- name: for the local host name, for example
EXAMPLE
. - canonical-name: for the local canonical host name, for example
EXAMPLE.apache.org
. - address: for the local host address, for example
192.168.56.1
.
- Since:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final LocalHostStringLookup
Defines the singleton for this class.Fields inherited from class org.apache.commons.text.lookup.AbstractStringLookup
SPLIT_CH, SPLIT_STR
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
No need to build instances for now. -
Method Summary
Methods inherited from class org.apache.commons.text.lookup.AbstractStringLookup
substringAfter, substringAfter, substringAfterLast, toLookupKey, toLookupKey
-
Field Details
-
INSTANCE
Defines the singleton for this class.
-
-
Constructor Details
-
LocalHostStringLookup
private LocalHostStringLookup()No need to build instances for now.
-
-
Method Details
-
lookup
Looks up the value of a local host key.- Parameters:
key
- the key to be looked up, may be null.- Returns:
- The value of the environment variable.
-