Class NetworkInterface<A>


  • public class NetworkInterface<A>
    extends java.lang.Object
    • Method Detail

      • getName

        public java.lang.String getName()
        Gets the network interface name.
        Returns:
        the name
      • getDhcp

        public ConfigurationProperty<java.lang.Boolean> getDhcp()
        Gets the network interface DHCP option.
        Returns:
        the DHCP option; true for enabled; false for disabled
      • getLinkLocalAddressing

        public ConfigurationProperty<java.lang.Boolean> getLinkLocalAddressing()
        Gets the network interface LinkLocalAddressing option.
        Returns:
        the LinkLocalAddressing option; true for enabled; false for disabled
      • getGateway

        public ConfigurationProperty<java.net.Inet4Address> getGateway()
        Gets the network interface Gateway.
        Returns:
        the Gateway
      • getDns

        public ConfigurationProperty<java.net.Inet4Address> getDns()
        Gets the network interface DNS server.
        Returns:
        the DNS server
      • getAttachment

        public A getAttachment()
        Gets the network interface attachment.

        An arbitrary attachment to this NetworkInterface. Can be used to store e.g. a configuration file path.

        Returns:
        the attachment
      • toJson

        public com.google.gson.JsonObject toJson()
        Exports this NetworkInterface configuration as JSON.
         {
           "dhcp": boolean,
           "linkLocalAddressing": boolean,
           "gateway": string,
           "dns": string,
           "addresses": string[]
         }
         
        Returns:
        configuration as JSON
      • updateFrom

        public boolean updateFrom​(NetworkInterface<?> change)
        Updates the interface from a NetworkInterfaceChange object.
        Parameters:
        change - the object containing the changes
        Returns:
        true if values changed