Record Class Cidr.V4
java.lang.Object
java.lang.Record
io.codemine.java.postgresql.codecs.Cidr.V4
- Record Components:
address- IPv4 network address as a 32-bit big-endian word (host bits must be zero).netmask- Network mask length in the range 0–32.
- All Implemented Interfaces:
Cidr
- Enclosing interface:
Cidr
IPv4 CIDR block.
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionV4(int address, byte netmask) Canonical constructor that enforces the documented invariants. -
Method Summary
Modifier and TypeMethodDescriptionintaddress()Returns the value of theaddressrecord component.voidAppends the PostgreSQL text representation of this CIDR block tosb.voidEncodes this CIDR block 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.toString()Returns a string representation of this record class.
-
Constructor Details
-
V4
public V4(int address, byte netmask) Canonical constructor that enforces the documented invariants.netmaskmust be in the range 0–32 (inclusive)- all host bits of
addressbeyond the netmask must be zero
- Throws:
IllegalArgumentException- if the arguments do not satisfy the invariants
-
-
Method Details
-
appendInTextTo
Description copied from interface:CidrAppends the PostgreSQL text representation of this CIDR block tosb.- Specified by:
appendInTextToin interfaceCidr
-
encodeInBinary
Description copied from interface:CidrEncodes this CIDR block in PostgreSQL binary wire format intoout.- Specified by:
encodeInBinaryin interfaceCidr
-
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
-