Package com.soebes.ip
Record Class IPv4Address
java.lang.Object
java.lang.Record
com.soebes.ip.IPv4Address
-
Constructor Summary
ConstructorDescriptionIPv4Address
(int t1, int t2, int t3, int t4) Creates an instance of aIPv4Address
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.int
first16()
final int
hashCode()
Returns a hash code value for this object.int
second16()
int
t1()
Returns the value of thet1
record component.int
t2()
Returns the value of thet2
record component.int
t3()
Returns the value of thet3
record component.int
t4()
Returns the value of thet4
record component.toString()
Returns a string representation of this record class.
-
Constructor Details
-
IPv4Address
public IPv4Address(int t1, int t2, int t3, int t4) Creates an instance of aIPv4Address
record class.- Parameters:
t1
- the value for thet1
record componentt2
- the value for thet2
record componentt3
- the value for thet3
record componentt4
- the value for thet4
record component
-
-
Method Details
-
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. -
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 '=='. -
first16
public int first16() -
second16
public int second16() -
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. -
t1
public int t1()Returns the value of thet1
record component.- Returns:
- the value of the
t1
record component
-
t2
public int t2()Returns the value of thet2
record component.- Returns:
- the value of the
t2
record component
-
t3
public int t3()Returns the value of thet3
record component.- Returns:
- the value of the
t3
record component
-
t4
public int t4()Returns the value of thet4
record component.- Returns:
- the value of the
t4
record component
-