Compares the message bytes to the specified String object. @param s the String to compare @return true if the comparison succeeded, false otherwise
(String s)
| 384 | * @return <code>true</code> if the comparison succeeded, <code>false</code> otherwise |
| 385 | */ |
| 386 | public boolean equals(String s) { |
| 387 | return switch (type) { |
| 388 | case T_STR -> { |
| 389 | if (strValue == null) { |
| 390 | yield s == null; |
| 391 | } |
| 392 | yield strValue.equals(s); |
| 393 | } |
| 394 | case T_CHARS -> charC.equals(s); |
| 395 | case T_BYTES -> byteC.equals(s); |
| 396 | default -> false; |
| 397 | }; |
| 398 | } |
| 399 | |
| 400 | /** |
| 401 | * Compares the message bytes to the specified String object. |