Class LocalHostStringLookup

java.lang.Object
org.apache.commons.text.lookup.AbstractStringLookup
org.apache.commons.text.lookup.LocalHostStringLookup
All Implemented Interfaces:
StringLookup

final class LocalHostStringLookup extends AbstractStringLookup
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 Details

  • Constructor Details

    • LocalHostStringLookup

      private LocalHostStringLookup()
      No need to build instances for now.
  • Method Details

    • lookup

      public String lookup(String key)
      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.