Package oshi.software.common
Class AbstractNetworkParams
java.lang.Object
oshi.software.common.AbstractNetworkParams
- All Implemented Interfaces:
NetworkParams
- Direct Known Subclasses:
OpenBsdNetworkParams
Common NetworkParams implementation.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionString[]
Gets the DNS Servers configured for this machine.Gets the Domain Name of the machine executing OSHI.Gets the HostName of the machine executing OSHI.protected static String
searchGateway
(List<String> lines) Convenience method to parse the output of the `route` command.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface oshi.software.os.NetworkParams
getIpv4DefaultGateway, getIpv6DefaultGateway
-
Constructor Details
-
AbstractNetworkParams
public AbstractNetworkParams()
-
-
Method Details
-
getDomainName
Description copied from interface:NetworkParams
Gets the Domain Name of the machine executing OSHI.- Specified by:
getDomainName
in interfaceNetworkParams
- Returns:
- the domain name
-
getHostName
Description copied from interface:NetworkParams
Gets the HostName of the machine executing OSHI.- Specified by:
getHostName
in interfaceNetworkParams
- Returns:
- the hostname
-
getDnsServers
Description copied from interface:NetworkParams
Gets the DNS Servers configured for this machine.- Specified by:
getDnsServers
in interfaceNetworkParams
- Returns:
- the DNS servers
-
searchGateway
Convenience method to parse the output of the `route` command. While the command arguments vary between OS's the output is consistently parsable.- Parameters:
lines
- output of OS-specific route command- Returns:
- default gateway
-
toString
-