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 TypeMethodDescriptionvoidclose()The message should be closed when it is no longer needed.static StringMessageStandardCharsets.UTF_8decodes the message.StandardCharsets.UTF_8encodes the message.Gets a String representation of this message.booleanTwo messages of the same type with the same body must be considered equal.Gets the message type.inthashCode()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_8decodes the message. -
toString
-
equals
Description copied from interface:MessageTwo messages of the same type with the same body must be considered equal. -
hashCode
public int hashCode()Description copied from interface:MessageThe hash code must be consistent with equals. -
getMessageType
Description copied from interface:MessageGets the message type.- Specified by:
getMessageTypein interfaceMessage
-
encodeAsString
Description copied from interface:MessageGets a String representation of this message.- Specified by:
encodeAsStringin interfaceMessage
-
encodeAsByteArray
StandardCharsets.UTF_8encodes the message.- Specified by:
encodeAsByteArrayin interfaceMessage
-
close
public void close()Description copied from interface:MessageThe message should be closed when it is no longer needed. -
getMessage
-
