public boolean isText ( ) { boolean isJson = contentType . map ( contentType -> "application/json" . equals ( contentType ) ) . orElse ( false ) ; boolean isPlainText = contentType . map ( contentType -> "text/plain" . equals ( contentType ) ) . orElse ( false ) ; return charset . isPresent ( ) || isJson || isPlainText ; }
Whether this message protocol is a text based protocol .