Record Class Network
java.lang.Object
java.lang.Record
com.maxmind.db.Network
- Record Components:
ipAddress- An IP address in the network. This does not have to be the first address in the network.prefixLength- The prefix length for the network. This is the number of leading 1 bits in the subnet mask, sometimes also known as netmask length.
Network represents an IP network.-
Constructor Summary
ConstructorsConstructorDescriptionNetwork(InetAddress ipAddress, int prefixLength) Creates an instance of aNetworkrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theipAddressrecord component.intReturns the value of theprefixLengthrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
Network
Creates an instance of aNetworkrecord class.- Parameters:
ipAddress- the value for theipAddressrecord componentprefixLength- the value for theprefixLengthrecord component
-
-
Method Details
-
networkAddress
- Returns:
- The first address in the network.
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
ipAddress
-
prefixLength
public int prefixLength()Returns the value of theprefixLengthrecord component.- Returns:
- the value of the
prefixLengthrecord component
-