Record Class ChatMessage
java.lang.Object
java.lang.Record
io.github.seenings.chat.model.ChatMessage
- Record Components:
id- 聊天记录IDcontentTypeId- 聊天内容类型contentId- 聊天内容IDfromUserId- 消息来源toUserId- 消息目标sent- 是否已发送sendTime- 发送时间
-
Constructor Summary
ConstructorsConstructorDescriptionChatMessage(Integer id, Integer contentTypeId, Integer contentId, Long fromUserId, Long toUserId, Boolean sent, LocalDateTime sendTime) Creates an instance of aChatMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecontentIdrecord component.Returns the value of thecontentTypeIdrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefromUserIdrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.sendTime()Returns the value of thesendTimerecord component.sent()Returns the value of thesentrecord component.final StringtoString()Returns a string representation of this record class.toUserId()Returns the value of thetoUserIdrecord component.
-
Constructor Details
-
ChatMessage
public ChatMessage(Integer id, Integer contentTypeId, Integer contentId, Long fromUserId, Long toUserId, Boolean sent, LocalDateTime sendTime) Creates an instance of aChatMessagerecord class.- Parameters:
id- the value for theidrecord componentcontentTypeId- the value for thecontentTypeIdrecord componentcontentId- the value for thecontentIdrecord componentfromUserId- the value for thefromUserIdrecord componenttoUserId- the value for thetoUserIdrecord componentsent- the value for thesentrecord componentsendTime- the value for thesendTimerecord component
-
-
Method Details
-
toString
-
hashCode
-
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). -
id
-
contentTypeId
Returns the value of thecontentTypeIdrecord component.- Returns:
- the value of the
contentTypeIdrecord component
-
contentId
-
fromUserId
Returns the value of thefromUserIdrecord component.- Returns:
- the value of the
fromUserIdrecord component
-
toUserId
-
sent
-
sendTime
-