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 Details

    • DEFAULT

      public static final DecodeOptions 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

      public DecodeOptions(int indent, Delimiter delimiter, boolean strict, PathExpansion expandPaths)
      Creates an instance of a DecodeOptions record class.
      Parameters:
      indent - the value for the indent record component
      delimiter - the value for the delimiter record component
      strict - the value for the strict record component
      expandPaths - the value for the expandPaths record component
  • Method Details

    • withIndent

      public static DecodeOptions withIndent(int indent)
      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

      public static DecodeOptions withDelimiter(Delimiter delimiter)
      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

      public static DecodeOptions withStrict(boolean strict)
      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

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • indent

      public int indent()
      Returns the value of the indent record component.
      Returns:
      the value of the indent record component
    • delimiter

      public Delimiter delimiter()
      Returns the value of the delimiter record component.
      Returns:
      the value of the delimiter record component
    • strict

      public boolean strict()
      Returns the value of the strict record component.
      Returns:
      the value of the strict record component
    • expandPaths

      public PathExpansion expandPaths()
      Returns the value of the expandPaths record component.
      Returns:
      the value of the expandPaths record component