Record Class DecodeOptions
java.lang.Object
java.lang.Record
dev.toonformat.jtoon.DecodeOptions
- Record Components:
indent- Number of spaces per indentation level (default: 2)delimiter- Delimiter expected in tabular array rows and inline primitive arrays (default: COMMA)strict- Strict validation mode. When true, throws IllegalArgumentException on invalid input. When false, uses best-effort parsing and returns null on errors (default: true)expandPaths- Path expansion mode for dotted keys (default: OFF)
public record DecodeOptions(int indent, Delimiter delimiter, boolean strict, PathExpansion expandPaths)
extends Record
Configuration options for decoding TOON format to Java objects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DecodeOptionsDefault decoding options: 2 spaces indent, comma delimiter, strict validation, path expansion off -
Constructor Summary
ConstructorsConstructorDescriptionCreates DecodeOptions with default values.DecodeOptions(int indent, Delimiter delimiter, boolean strict, PathExpansion expandPaths) Creates an instance of aDecodeOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedelimiterrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpandPathsrecord component.final inthashCode()Returns a hash code value for this object.intindent()Returns the value of theindentrecord component.booleanstrict()Returns the value of thestrictrecord component.final StringtoString()Returns a string representation of this record class.static DecodeOptionswithDelimiter(Delimiter delimiter) Creates DecodeOptions with custom delimiter, using default indent and strict mode.static DecodeOptionswithIndent(int indent) Creates DecodeOptions with custom indent, using default delimiter and strict mode.static DecodeOptionswithStrict(boolean strict) Creates DecodeOptions with custom strict mode, using default indent and delimiter.
-
Field Details
-
DEFAULT
Default decoding options: 2 spaces indent, comma delimiter, strict validation, path expansion off
-
-
Constructor Details
-
DecodeOptions
public DecodeOptions()Creates DecodeOptions with default values. -
DecodeOptions
Creates an instance of aDecodeOptionsrecord class.- Parameters:
indent- the value for theindentrecord componentdelimiter- the value for thedelimiterrecord componentstrict- the value for thestrictrecord componentexpandPaths- the value for theexpandPathsrecord component
-
-
Method Details
-
withIndent
Creates DecodeOptions with custom indent, using default delimiter and strict mode.- Parameters:
indent- number of spaces per indentation level- Returns:
- a new DecodeOptions instance with the specified indent
-
withDelimiter
Creates DecodeOptions with custom delimiter, using default indent and strict mode.- Parameters:
delimiter- the delimiter to use for tabular arrays and inline primitive arrays- Returns:
- a new DecodeOptions instance with the specified delimiter
-
withStrict
Creates DecodeOptions with custom strict mode, using default indent and delimiter.- Parameters:
strict- whether to enable strict validation mode- Returns:
- a new DecodeOptions instance with the specified strict mode
-
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. -
indent
-
delimiter
-
strict
-
expandPaths
Returns the value of theexpandPathsrecord component.- Returns:
- the value of the
expandPathsrecord component
-