java.lang.Object
java.lang.Record
it.auties.whatsapp.model.mobile.PhoneNumber
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CountryCode
The field for thecountryCode
record component.private final long
The field for thenumberWithoutPrefix
record component. -
Constructor Summary
ConstructorsConstructorDescriptionPhoneNumber
(CountryCode countryCode, long numberWithoutPrefix) Creates an instance of aPhoneNumber
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecountryCode
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.long
number()
long
Returns the value of thenumberWithoutPrefix
record component.static PhoneNumber
of
(long phoneNumber) static PhoneNumber
static Optional
<PhoneNumber> ofNullable
(Long phoneNumber) prefix()
toJid()
toString()
Returns a string representation of this record class.
-
Field Details
-
countryCode
The field for thecountryCode
record component. -
numberWithoutPrefix
private final long numberWithoutPrefixThe field for thenumberWithoutPrefix
record component.
-
-
Constructor Details
-
PhoneNumber
Creates an instance of aPhoneNumber
record class.- Parameters:
countryCode
- the value for thecountryCode
record componentnumberWithoutPrefix
- the value for thenumberWithoutPrefix
record component
-
-
Method Details
-
ofNullable
-
of
-
of
-
number
public long number() -
prefix
-
toJid
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
countryCode
Returns the value of thecountryCode
record component.- Returns:
- the value of the
countryCode
record component
-
numberWithoutPrefix
public long numberWithoutPrefix()Returns the value of thenumberWithoutPrefix
record component.- Returns:
- the value of the
numberWithoutPrefix
record component
-