Class Inet

  • All Implemented Interfaces:
    java.io.Serializable

    public class Inet
    extends java.lang.Object
    implements java.io.Serializable
    The Inet object type is used to represent an IP address.

    For more details about how to use it, check out this article on vladmihalcea.com.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String address  
    • Constructor Summary

      Constructors 
      Constructor Description
      Inet​(java.lang.String address)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.String getAddress()  
      int hashCode()  
      java.net.InetAddress toInetAddress()
      Get the associated InetAddress for the current address.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • address

        private final java.lang.String address
    • Constructor Detail

      • Inet

        public Inet​(java.lang.String address)
    • Method Detail

      • getAddress

        public java.lang.String getAddress()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toInetAddress

        public java.net.InetAddress toInetAddress()
        Get the associated InetAddress for the current address.
        Returns:
        the associated InetAddress