Package dev.enola.chat
Record Class MessageImpl
java.lang.Object
java.lang.Record
dev.enola.chat.MessageImpl
- All Implemented Interfaces:
Message
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.enola.chat.Message
Message.Format -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the value of thecontentrecord component.Returns the value of thecreatedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.format()Returns the value of theformatrecord component.from()Returns the value of thefromrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of themodifiedAtrecord component.replyTo()Returns the value of thereplyTorecord component.subject()Returns the value of thesubjectrecord component.to()Returns the value of thetorecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MessageImpl
public MessageImpl(Object id, Optional<Object> replyTo, Subject from, Room to, Instant createdAt, Instant modifiedAt, Optional<String> subject, String content, Message.Format format) Creates an instance of aMessageImplrecord class.- Parameters:
id- the value for theidrecord componentreplyTo- the value for thereplyTorecord componentfrom- the value for thefromrecord componentto- the value for thetorecord componentcreatedAt- the value for thecreatedAtrecord componentmodifiedAt- the value for themodifiedAtrecord componentsubject- the value for thesubjectrecord componentcontent- the value for thecontentrecord componentformat- the value for theformatrecord 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
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). -
id
Returns the value of theidrecord component. -
replyTo
Returns the value of thereplyTorecord component. -
from
Returns the value of thefromrecord component. -
to
Returns the value of thetorecord component. -
createdAt
Returns the value of thecreatedAtrecord component. -
modifiedAt
Returns the value of themodifiedAtrecord component.- Specified by:
modifiedAtin interfaceMessage- Returns:
- the value of the
modifiedAtrecord component
-
subject
Returns the value of thesubjectrecord component.- Returns:
- the value of the
subjectrecord component
-
content
Returns the value of thecontentrecord component. -
format
Returns the value of theformatrecord component.
-