Record Class Cidr.V6
java.lang.Object
java.lang.Record
io.codemine.java.postgresql.codecs.Cidr.V6
- Record Components:
w1- First 32 bits of the IPv6 network address in big-endian order (host bits must be zero).w2- Second 32 bits of the IPv6 network address in big-endian order.w3- Third 32 bits of the IPv6 network address in big-endian order.w4- Fourth 32 bits of the IPv6 network address in big-endian order.netmask- Network mask length in the range 0–128.
- All Implemented Interfaces:
Cidr
- Enclosing interface:
Cidr
public static record Cidr.V6(int w1, int w2, int w3, int w4, byte netmask)
extends Record
implements Cidr
IPv6 CIDR block.
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionV6(int w1, int w2, int w3, int w4, byte netmask) Canonical constructor that enforces the documented invariants. -
Method Summary
Modifier and TypeMethodDescriptionvoidAppends 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.intw1()Returns the value of thew1record component.intw2()Returns the value of thew2record component.intw3()Returns the value of thew3record component.intw4()Returns the value of thew4record component.
-
Constructor Details
-
V6
public V6(int w1, int w2, int w3, int w4, byte netmask) Canonical constructor that enforces the documented invariants.netmaskmust be in the range 0–128 (inclusive)- all host bits of the address beyond 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 '=='. -
w1
public int w1()Returns the value of thew1record component.- Returns:
- the value of the
w1record component
-
w2
public int w2()Returns the value of thew2record component.- Returns:
- the value of the
w2record component
-
w3
public int w3()Returns the value of thew3record component.- Returns:
- the value of the
w3record component
-
w4
public int w4()Returns the value of thew4record component.- Returns:
- the value of the
w4record component
-
netmask
public byte netmask()Returns the value of thenetmaskrecord component.- Returns:
- the value of the
netmaskrecord component
-