Record Class Inet.V4
java.lang.Object
java.lang.Record
io.codemine.java.postgresql.codecs.Inet.V4
- Record Components:
address- IPv4 address as a 32-bit big-endian word.netmask- Network mask length in the range 0–32.
- All Implemented Interfaces:
Inet
- Enclosing interface:
Inet
IPv4 host address with optional subnet mask.
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintaddress()Returns the value of theaddressrecord component.voidAppends the PostgreSQL text representation of this address tosb.voidEncodes this address in PostgreSQL binary wire format intoout.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.bytenetmask()Returns the value of thenetmaskrecord component.static Inet.V4of(Inet4Address addr) Returns the address part of this value as aInet4Address.toString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
of
- Parameters:
addr- the IPv4 address
-
toInetAddress
Returns the address part of this value as aInet4Address. The netmask is not represented in the returned object.- Specified by:
toInetAddressin interfaceInet
-
appendInTextTo
Description copied from interface:InetAppends the PostgreSQL text representation of this address tosb.- Specified by:
appendInTextToin interfaceInet
-
encodeInBinary
Description copied from interface:InetEncodes this address in PostgreSQL binary wire format intoout.- Specified by:
encodeInBinaryin interfaceInet
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
address
public int address()Returns the value of theaddressrecord component.- Returns:
- the value of the
addressrecord component
-
netmask
public byte netmask()Returns the value of thenetmaskrecord component.- Returns:
- the value of the
netmaskrecord component
-