Package dev.tobee.telegram.model.chat
Record Class Chat
java.lang.Object
java.lang.Record
dev.tobee.telegram.model.chat.Chat
public record Chat(Integer id, ChatType type, Optional<String> title, Optional<String> username, Optional<String> firstName, Optional<String> lastName, Optional<ChatPhoto> photo, Optional<String> bio, boolean hasPrivateForwards, Optional<String> description, Optional<String> inviteLink, Optional<Message> pinnedMessage, Optional<ChatPermissions> permissions, OptionalInt slowModeDelay, OptionalInt messageAutoDeleteTime, boolean hasProtectedContent, Optional<String> stickerSetName, Optional<Boolean> canSetStickerSet, OptionalInt linkedChatId, Optional<ChatLocation> location)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionChat(Integer id, ChatType type, Optional<String> title, Optional<String> username, Optional<String> firstName, Optional<String> lastName, Optional<ChatPhoto> photo, Optional<String> bio, boolean hasPrivateForwards, Optional<String> description, Optional<String> inviteLink, Optional<Message> pinnedMessage, Optional<ChatPermissions> permissions, OptionalInt slowModeDelay, OptionalInt messageAutoDeleteTime, boolean hasProtectedContent, Optional<String> stickerSetName, Optional<Boolean> canSetStickerSet, OptionalInt linkedChatId, Optional<ChatLocation> location) Creates an instance of aChatrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbio()Returns the value of thebiorecord component.Returns the value of thecanSetStickerSetrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstNamerecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasPrivateForwardsrecord component.booleanReturns the value of thehasProtectedContentrecord component.id()Returns the value of theidrecord component.Returns the value of theinviteLinkrecord component.lastName()Returns the value of thelastNamerecord component.Returns the value of thelinkedChatIdrecord component.location()Returns the value of thelocationrecord component.Returns the value of themessageAutoDeleteTimerecord component.Returns the value of thepermissionsrecord component.photo()Returns the value of thephotorecord component.Returns the value of thepinnedMessagerecord component.Returns the value of theslowModeDelayrecord component.Returns the value of thestickerSetNamerecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.username()Returns the value of theusernamerecord component.
-
Constructor Details
-
Chat
public Chat(Integer id, ChatType type, Optional<String> title, Optional<String> username, Optional<String> firstName, Optional<String> lastName, Optional<ChatPhoto> photo, Optional<String> bio, boolean hasPrivateForwards, Optional<String> description, Optional<String> inviteLink, Optional<Message> pinnedMessage, Optional<ChatPermissions> permissions, OptionalInt slowModeDelay, OptionalInt messageAutoDeleteTime, boolean hasProtectedContent, Optional<String> stickerSetName, Optional<Boolean> canSetStickerSet, OptionalInt linkedChatId, Optional<ChatLocation> location) Creates an instance of aChatrecord class.- Parameters:
id- the value for theidrecord componenttype- the value for thetyperecord componenttitle- the value for thetitlerecord componentusername- the value for theusernamerecord componentfirstName- the value for thefirstNamerecord componentlastName- the value for thelastNamerecord componentphoto- the value for thephotorecord componentbio- the value for thebiorecord componenthasPrivateForwards- the value for thehasPrivateForwardsrecord componentdescription- the value for thedescriptionrecord componentinviteLink- the value for theinviteLinkrecord componentpinnedMessage- the value for thepinnedMessagerecord componentpermissions- the value for thepermissionsrecord componentslowModeDelay- the value for theslowModeDelayrecord componentmessageAutoDeleteTime- the value for themessageAutoDeleteTimerecord componenthasProtectedContent- the value for thehasProtectedContentrecord componentstickerSetName- the value for thestickerSetNamerecord componentcanSetStickerSet- the value for thecanSetStickerSetrecord componentlinkedChatId- the value for thelinkedChatIdrecord componentlocation- the value for thelocationrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord 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
-
photo
Returns the value of thephotorecord component.- Returns:
- the value of the
photorecord component
-
bio
Returns the value of thebiorecord component.- Returns:
- the value of the
biorecord component
-
hasPrivateForwards
public boolean hasPrivateForwards()Returns the value of thehasPrivateForwardsrecord component.- Returns:
- the value of the
hasPrivateForwardsrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
inviteLink
Returns the value of theinviteLinkrecord component.- Returns:
- the value of the
inviteLinkrecord component
-
pinnedMessage
Returns the value of thepinnedMessagerecord component.- Returns:
- the value of the
pinnedMessagerecord component
-
permissions
Returns the value of thepermissionsrecord component.- Returns:
- the value of the
permissionsrecord component
-
slowModeDelay
Returns the value of theslowModeDelayrecord component.- Returns:
- the value of the
slowModeDelayrecord component
-
messageAutoDeleteTime
Returns the value of themessageAutoDeleteTimerecord component.- Returns:
- the value of the
messageAutoDeleteTimerecord component
-
hasProtectedContent
public boolean hasProtectedContent()Returns the value of thehasProtectedContentrecord component.- Returns:
- the value of the
hasProtectedContentrecord component
-
stickerSetName
Returns the value of thestickerSetNamerecord component.- Returns:
- the value of the
stickerSetNamerecord component
-
canSetStickerSet
Returns the value of thecanSetStickerSetrecord component.- Returns:
- the value of the
canSetStickerSetrecord component
-
linkedChatId
Returns the value of thelinkedChatIdrecord component.- Returns:
- the value of the
linkedChatIdrecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-