Record Class RemoteChatMessage
java.lang.Object
java.lang.Record
io.github.seenings.chat.model.RemoteChatMessage
- Record Components:
id- 记录的唯一标识符contentTypeId- 聊天信息的内容类型标识符contentId- 聊天信息的内容标识符fromUserId- 发送方用户的标识符sendTime- 聊天信息发送时间sent- 是否已发送toUserId- 接收方用户的标识符
public record RemoteChatMessage(int id, int contentTypeId, int contentId, Long fromUserId, LocalDateTime sendTime, boolean sent, Long toUserId)
extends Record
表示远程聊天信息的记录类型
-
Constructor Summary
ConstructorsConstructorDescriptionRemoteChatMessage(int id, int contentTypeId, int contentId, Long fromUserId, LocalDateTime sendTime, boolean sent, Long toUserId) Creates an instance of aRemoteChatMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecontentIdrecord component.intReturns 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.intid()Returns the value of theidrecord component.sendTime()Returns the value of thesendTimerecord component.booleansent()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
-
RemoteChatMessage
public RemoteChatMessage(int id, int contentTypeId, int contentId, Long fromUserId, LocalDateTime sendTime, boolean sent, Long toUserId) Creates an instance of aRemoteChatMessagerecord class.- Parameters:
id- the value for theidrecord componentcontentTypeId- the value for thecontentTypeIdrecord componentcontentId- the value for thecontentIdrecord componentfromUserId- the value for thefromUserIdrecord componentsendTime- the value for thesendTimerecord componentsent- the value for thesentrecord componenttoUserId- the value for thetoUserIdrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
-
contentTypeId
public int 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
-
sendTime
-
sent
-
toUserId
-