浏览代码

Expose HexFormat in Painless (#112412)

Java 17 introduced a utility for parsing and formatting bytes as
hexadecimal strings. This commit exposes that class in Painless.
Ryan Ernst 1 年之前
父节点
当前提交
bb1070475d

+ 5 - 0
docs/changelog/112412.yaml

@@ -0,0 +1,5 @@
+pr: 112412
+summary: Expose `HexFormat` in Painless
+area: Infra/Scripting
+type: enhancement
+issues: []

+ 18 - 0
modules/lang-painless/src/main/resources/org/elasticsearch/painless/java.util.txt

@@ -684,6 +684,24 @@ class java.util.Hashtable {
   def clone()
 }
 
+class java.util.HexFormat {
+  HexFormat of()
+  HexFormat ofDelimiter(String)
+  HexFormat withDelimiter(String)
+  HexFormat withPrefix(String)
+  HexFormat withSuffix(String)
+  HexFormat withUpperCase()
+  HexFormat withLowerCase()
+  String delimiter()
+  String prefix()
+  String suffix()
+  boolean isUpperCase()
+  String formatHex(byte[])
+  String formatHex(byte[],int,int)
+  byte[] parseHex(CharSequence)
+  byte[] parseHex(CharSequence,int,int)
+}
+
 class java.util.IdentityHashMap {
   ()
   (Map)