Record Class JsonSecurity.SecurityOptions
java.lang.Object
java.lang.Record
cloud.opencode.base.json.security.JsonSecurity.SecurityOptions
- Enclosing class:
JsonSecurity
public static record JsonSecurity.SecurityOptions(int maxDepth, int maxStringLength, int maxEntries, boolean rejectDangerousKeys, boolean sanitizeStrings)
extends Record
Security options for JSON parsing.
JSON 解析的安全选项。
- Since:
- JDK 25, opencode-base-json V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionSecurityOptions(int maxDepth, int maxStringLength, int maxEntries, boolean rejectDangerousKeys, boolean sanitizeStrings) Creates an instance of aSecurityOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static JsonSecurity.SecurityOptionsdefaults()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmaxDepth()Returns the value of themaxDepthrecord component.intReturns the value of themaxEntriesrecord component.intReturns the value of themaxStringLengthrecord component.booleanReturns the value of therejectDangerousKeysrecord component.booleanReturns the value of thesanitizeStringsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SecurityOptions
public SecurityOptions(int maxDepth, int maxStringLength, int maxEntries, boolean rejectDangerousKeys, boolean sanitizeStrings) Creates an instance of aSecurityOptionsrecord class.- Parameters:
maxDepth- the value for themaxDepthrecord componentmaxStringLength- the value for themaxStringLengthrecord componentmaxEntries- the value for themaxEntriesrecord componentrejectDangerousKeys- the value for therejectDangerousKeysrecord componentsanitizeStrings- the value for thesanitizeStringsrecord component
-
-
Method Details
-
defaults
-
builder
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
maxDepth
public int maxDepth()Returns the value of themaxDepthrecord component.- Returns:
- the value of the
maxDepthrecord component
-
maxStringLength
public int maxStringLength()Returns the value of themaxStringLengthrecord component.- Returns:
- the value of the
maxStringLengthrecord component
-
maxEntries
public int maxEntries()Returns the value of themaxEntriesrecord component.- Returns:
- the value of the
maxEntriesrecord component
-
rejectDangerousKeys
public boolean rejectDangerousKeys()Returns the value of therejectDangerousKeysrecord component.- Returns:
- the value of the
rejectDangerousKeysrecord component
-
sanitizeStrings
public boolean sanitizeStrings()Returns the value of thesanitizeStringsrecord component.- Returns:
- the value of the
sanitizeStringsrecord component
-