- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
ByteArrayMessage
,FileMessage
,MultiMessage
,StringMessage
Any type of encapsulated message.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
The message should be closed when it is no longer needed.Gets a binary representation of this 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.
-
Method Details
-
equals
Two messages of the same type with the same body must be considered equal. -
hashCode
int hashCode()The hash code must be consistent with equals. -
getMessageType
MessageType getMessageType()Gets the message type. -
encodeAsString
Gets a String representation of this message.- Throws:
IOException
-
encodeAsByteArray
Gets a binary representation of this message.- Throws:
IOException
-
close
The message should be closed when it is no longer needed.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-