Record Class EncodeOptions
java.lang.Object
java.lang.Record
dev.toonformat.jtoon.EncodeOptions
- Record Components:
indent- Number of spaces per indentation level (default: 2)delimiter- Delimiter to use for tabular array rows and inline primitive arrays (default: COMMA)lengthMarker- Optional marker to prefix array lengths in headers. When true, arrays render as [#N] instead of [N] (default: false)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EncodeOptionsDefault encoding options: 2 spaces indent, comma delimiter, no length marker -
Constructor Summary
ConstructorsConstructorDescriptionCreates EncodeOptions with default values.EncodeOptions(int indent, Delimiter delimiter, boolean lengthMarker) Creates an instance of aEncodeOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedelimiterrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intindent()Returns the value of theindentrecord component.booleanReturns the value of thelengthMarkerrecord component.final StringtoString()Returns a string representation of this record class.static EncodeOptionswithDelimiter(Delimiter delimiter) Creates EncodeOptions with custom delimiter, using default indent and length marker.static EncodeOptionswithIndent(int indent) Creates EncodeOptions with custom indent, using default delimiter and length marker.static EncodeOptionswithLengthMarker(boolean lengthMarker) Creates EncodeOptions with custom length marker, using default indent and delimiter.
-
Field Details
-
DEFAULT
Default encoding options: 2 spaces indent, comma delimiter, no length marker
-
-
Constructor Details
-
EncodeOptions
public EncodeOptions()Creates EncodeOptions with default values. -
EncodeOptions
Creates an instance of aEncodeOptionsrecord class.- Parameters:
indent- the value for theindentrecord componentdelimiter- the value for thedelimiterrecord componentlengthMarker- the value for thelengthMarkerrecord component
-
-
Method Details
-
withIndent
Creates EncodeOptions with custom indent, using default delimiter and length marker.- Parameters:
indent- number of spaces per indentation level- Returns:
- a new EncodeOptions instance with the specified indent
-
withDelimiter
Creates EncodeOptions with custom delimiter, using default indent and length marker.- Parameters:
delimiter- the delimiter to use for tabular arrays and inline primitive arrays- Returns:
- a new EncodeOptions instance with the specified delimiter
-
withLengthMarker
Creates EncodeOptions with custom length marker, using default indent and delimiter.- Parameters:
lengthMarker- whether to include the # marker before array lengths- Returns:
- a new EncodeOptions instance with the specified length marker setting
-
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
-
lengthMarker
public boolean lengthMarker()Returns the value of thelengthMarkerrecord component.- Returns:
- the value of the
lengthMarkerrecord component
-