java.lang.Object
java.lang.Record
it.auties.whatsapp.model.mobile.PhoneNumber
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CountryCodeThe field for thecountryCoderecord component.private final longThe field for thenumberWithoutPrefixrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPhoneNumber(CountryCode countryCode, long numberWithoutPrefix) Creates an instance of aPhoneNumberrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecountryCoderecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longnumber()longReturns the value of thenumberWithoutPrefixrecord component.static PhoneNumberof(long phoneNumber) static PhoneNumberstatic Optional<PhoneNumber> ofNullable(Long phoneNumber) prefix()toJid()toString()Returns a string representation of this record class.
-
Field Details
-
countryCode
The field for thecountryCoderecord component. -
numberWithoutPrefix
private final long numberWithoutPrefixThe field for thenumberWithoutPrefixrecord component.
-
-
Constructor Details
-
PhoneNumber
Creates an instance of aPhoneNumberrecord class.- Parameters:
countryCode- the value for thecountryCoderecord componentnumberWithoutPrefix- the value for thenumberWithoutPrefixrecord 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 thecountryCoderecord component.- Returns:
- the value of the
countryCoderecord component
-
numberWithoutPrefix
public long numberWithoutPrefix()Returns the value of thenumberWithoutPrefixrecord component.- Returns:
- the value of the
numberWithoutPrefixrecord component
-