Record Class JsonTruncator.TruncateConfig
java.lang.Object
java.lang.Record
cloud.opencode.base.json.util.JsonTruncator.TruncateConfig
- Record Components:
maxLength- soft limit for output characters; actual output may be slightly larger due to structural closing brackets (default 1024) - 输出字符数的软限制;实际输出可能因结构闭合括号而略大(默认 1024)maxArrayElements- maximum array items to show (default 3) - 显示的最大数组项数maxStringLength- maximum string value characters (default 100) - 最大字符串值字符数maxDepth- maximum nesting depth (default 5) - 最大嵌套深度truncationMarker- the truncation marker string (default "...") - 截断标记字符串
- Enclosing class:
JsonTruncator
public static record JsonTruncator.TruncateConfig(int maxLength, int maxArrayElements, int maxStringLength, int maxDepth, String truncationMarker)
extends Record
Truncation configuration record.
截断配置记录。
- Since:
- JDK 25, opencode-base-json V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonTruncator.TruncateConfigDefault truncation configuration. -
Constructor Summary
ConstructorsConstructorDescriptionTruncateConfig(int maxLength, int maxArrayElements, int maxStringLength, int maxDepth, String truncationMarker) Validates the configuration parameters. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxArrayElementsrecord component.intmaxDepth()Returns the value of themaxDepthrecord component.intReturns the value of themaxLengthrecord component.intReturns the value of themaxStringLengthrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetruncationMarkerrecord component.
-
Field Details
-
DEFAULT
Default truncation configuration. 默认截断配置。
-
-
Constructor Details
-
TruncateConfig
public TruncateConfig(int maxLength, int maxArrayElements, int maxStringLength, int maxDepth, String truncationMarker) Validates the configuration parameters. 验证配置参数。
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
maxLength
-
maxArrayElements
public int maxArrayElements()Returns the value of themaxArrayElementsrecord component.- Returns:
- the value of the
maxArrayElementsrecord component
-
maxStringLength
public int maxStringLength()Returns the value of themaxStringLengthrecord component.- Returns:
- the value of the
maxStringLengthrecord component
-
maxDepth
-
truncationMarker
Returns the value of thetruncationMarkerrecord component.- Returns:
- the value of the
truncationMarkerrecord component
-