Skip to content

Commit 83fd221

Browse files
committed
Add javadoc for hexing method
1 parent 9c548d1 commit 83fd221

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/io/github/malczuuu/problem4j/core/JsonEscape.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ private static boolean shouldBeHexed(char character) {
4848
|| character >= '\u2000' && character <= '\u20FF';
4949
}
5050

51+
/**
52+
* Appends the Unicode hexadecimal escape sequence for the given character to the result. The
53+
* escape sequence is in the format {@code "\\uXXXX"}, where {@code "XXXX"} is the uppercase
54+
* hexadecimal representation of the character code, padded with leading zeros to four digits.
55+
*
56+
* @param result the StringBuilder to append the escape sequence to
57+
* @param character the character to be escaped
58+
*/
5159
private static void hex(StringBuilder result, char character) {
5260
String hexedCharacter = Integer.toHexString(character);
5361
result.append("\\u");

0 commit comments

Comments
 (0)