java.lang.Object
io.hypersistence.utils.hibernate.type.basic.Inet
All Implemented Interfaces:
Serializable, Comparable<Inet>

public class Inet extends Object implements Serializable, Comparable<Inet>
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.

Author:
Vlad Mihalcea
See Also:
  • Constructor Details

    • Inet

      public Inet(String address)
  • Method Details

    • getAddress

      public String getAddress()
    • compareTo

      public int compareTo(Inet other)
      Compares the stored address strings lexicographically, without normalizing IP addresses or applying PostgreSQL network ordering. Null addresses sort first.
      Specified by:
      compareTo in interface Comparable<Inet>
      Parameters:
      other - the Inet to compare to
      Returns:
      the comparison result
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

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