com.eurotech.framework.core.net
Class NetInterfaceAddressImpl

java.lang.Object
  extended by com.eurotech.framework.core.net.NetInterfaceAddressImpl
All Implemented Interfaces:
NetInterfaceAddress
Direct Known Subclasses:
ModemInterfaceAddressImpl, NetInterfaceAddressConfigImpl, WifiInterfaceAddressImpl

public class NetInterfaceAddressImpl
extends Object
implements NetInterfaceAddress


Constructor Summary
NetInterfaceAddressImpl()
           
NetInterfaceAddressImpl(NetInterfaceAddress other)
           
 
Method Summary
protected  boolean compare(Object obj1, Object obj2)
           
 boolean equals(Object obj)
           
 IPAddress getAddress()
          Returns an InetAddress for this address.
 IPAddress getBroadcast()
          Returns an InetAddress for the broadcast address for this InterfaceAddress.
 List<? extends IPAddress> getDnsServers()
          Gets the list of DNS servers associated with this interface
 IPAddress getGateway()
          Returns the InetAddress for the gateway.
 IPAddress getNetmask()
          Returns the network mask for this address Typical IPv4 values would be 255.0.0.0, 255.255.0.0 or 255.255.255.0.
 short getNetworkPrefixLength()
          Returns the network prefix length for this address.
 void setAddress(IPAddress address)
           
 void setBroadcast(IPAddress broadcast)
           
 void setDnsServers(List<? extends IPAddress> dnsAddresses)
           
 void setGateway(IPAddress gateway)
           
 void setNetmask(IPAddress netmask)
           
 void setNetworkPrefixLength(short networkPrefixLength)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetInterfaceAddressImpl

public NetInterfaceAddressImpl()

NetInterfaceAddressImpl

public NetInterfaceAddressImpl(NetInterfaceAddress other)
Method Detail

getAddress

public IPAddress getAddress()
Description copied from interface: NetInterfaceAddress
Returns an InetAddress for this address.

Specified by:
getAddress in interface NetInterfaceAddress
Returns:
the address

setAddress

public void setAddress(IPAddress address)

getNetworkPrefixLength

public short getNetworkPrefixLength()
Description copied from interface: NetInterfaceAddress
Returns the network prefix length for this address. This is also known as the subnet mask in the context of IPv4 addresses. Typical IPv4 values would be 8 (255.0.0.0), 16 (255.255.0.0) or 24 (255.255.255.0). Typical IPv6 values would be 128 (::1/128) or 10 (fe80::203:baff:fe27:1243/10)

Specified by:
getNetworkPrefixLength in interface NetInterfaceAddress
Returns:
a short representing the prefix length for the subnet of that address.

setNetworkPrefixLength

public void setNetworkPrefixLength(short networkPrefixLength)

getNetmask

public IPAddress getNetmask()
Description copied from interface: NetInterfaceAddress
Returns the network mask for this address Typical IPv4 values would be 255.0.0.0, 255.255.0.0 or 255.255.255.0. Typical IPv6 values would be ::1/128 or fe80::203:baff:fe27:1243/10

Specified by:
getNetmask in interface NetInterfaceAddress
Returns:
an IPaddress representing the subnet mask of that address

setNetmask

public void setNetmask(IPAddress netmask)

getGateway

public IPAddress getGateway()
Description copied from interface: NetInterfaceAddress
Returns the InetAddress for the gateway.

Specified by:
getGateway in interface NetInterfaceAddress
Returns:
the gateway address

setGateway

public void setGateway(IPAddress gateway)

getBroadcast

public IPAddress getBroadcast()
Description copied from interface: NetInterfaceAddress
Returns an InetAddress for the broadcast address for this InterfaceAddress.

Specified by:
getBroadcast in interface NetInterfaceAddress
Returns:
the broadcast address

setBroadcast

public void setBroadcast(IPAddress broadcast)

getDnsServers

public List<? extends IPAddress> getDnsServers()
Description copied from interface: NetInterfaceAddress
Gets the list of DNS servers associated with this interface

Specified by:
getDnsServers in interface NetInterfaceAddress
Returns:
the list of DNS servers

setDnsServers

public void setDnsServers(List<? extends IPAddress> dnsAddresses)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

compare

protected boolean compare(Object obj1,
                          Object obj2)


Copyright © 2013. All Rights Reserved.