Package dev.tobee.telegram.model
Record Class Contact
java.lang.Object
java.lang.Record
dev.tobee.telegram.model.Contact
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstNamerecord component.inthashCode()Returns a hash code value for this object.lastName()Returns the value of thelastNamerecord component.Returns the value of thephoneNumberrecord component.toString()Returns a string representation of this record class.userId()Returns the value of theuserIdrecord component.vcard()Returns the value of thevcardrecord component.
-
Constructor Details
-
Contact
public Contact(String phoneNumber, String firstName, Optional<String> lastName, OptionalInt userId, Optional<String> vcard)Creates an instance of aContactrecord class.- Parameters:
phoneNumber- the value for thephoneNumberrecord componentfirstName- the value for thefirstNamerecord componentlastName- the value for thelastNamerecord componentuserId- the value for theuserIdrecord componentvcard- the value for thevcardrecord 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. -
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 withObjects::equals(Object,Object). -
phoneNumber
Returns the value of thephoneNumberrecord component.- Returns:
- the value of the
phoneNumberrecord component
-
firstName
Returns the value of thefirstNamerecord component.- Returns:
- the value of the
firstNamerecord component
-
lastName
Returns the value of thelastNamerecord component.- Returns:
- the value of the
lastNamerecord component
-
userId
Returns the value of theuserIdrecord component.- Returns:
- the value of the
userIdrecord component
-
vcard
Returns the value of thevcardrecord component.- Returns:
- the value of the
vcardrecord component
-