java.lang.Object
com.aoapps.messaging.StringMessage
- All Implemented Interfaces:
Message
,Closeable
,AutoCloseable
A message that is a String.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
The message should be closed when it is no longer needed.static StringMessage
StandardCharsets.UTF_8
decodes the message.StandardCharsets.UTF_8
encodes the message.Gets a String representation of this message.boolean
Two messages of the same type with the same body must be considered equal.Gets the message type.int
hashCode()
The hash code must be consistent with equals.toString()
-
Field Details
-
EMPTY_STRING_MESSAGE
-
-
Constructor Details
-
StringMessage
Creates a newStringMessage
.
-
-
Method Details
-
decode
StandardCharsets.UTF_8
decodes the message. -
toString
-
equals
Description copied from interface:Message
Two messages of the same type with the same body must be considered equal. -
hashCode
public int hashCode()Description copied from interface:Message
The hash code must be consistent with equals. -
getMessageType
Description copied from interface:Message
Gets the message type.- Specified by:
getMessageType
in interfaceMessage
-
encodeAsString
Description copied from interface:Message
Gets a String representation of this message.- Specified by:
encodeAsString
in interfaceMessage
-
encodeAsByteArray
StandardCharsets.UTF_8
encodes the message.- Specified by:
encodeAsByteArray
in interfaceMessage
-
close
public void close()Description copied from interface:Message
The message should be closed when it is no longer needed. -
getMessage
-