Class NestedTexts

java.lang.Object
org.loxlylabs.nestedtext.NestedTexts

public class NestedTexts extends Object
Utility class to serialize or deserialize with default configuration.
  • Method Details

    • dump

      public static String dump(Object obj)
      Dumps an object to a NestedText string using default settings.
      Parameters:
      obj - The object to serialize.
      Returns:
      The NestedText string representation.
    • from

      public static NestedText.Reader from(String content)
      Begins a fluent deserialization operation from a String source.
      Parameters:
      content - The NestedText string content.
      Returns:
      A NestedText.Reader instance to specify the target type.
      Throws:
      NestedTextException - if the string is not valid NestedText.
    • from

      public static NestedText.Reader from(Path path) throws IOException
      Begins a fluent deserialization operation from a Path source.
      Parameters:
      path - The path to the file containing NestedText.
      Returns:
      A NestedText.Reader instance to specify the target type.
      Throws:
      NestedTextException - if the file content is not valid NestedText.
      IOException - if an I/O error occurs while reading the file.
    • from

      public static NestedText.Reader from(byte[] data)
      Begins a fluent deserialization operation from a byte[] source.
      Parameters:
      data - The byte array containing NestedText data.
      Returns:
      A NestedText.Reader instance to specify the target type.
      Throws:
      NestedTextException - if the byte array is not valid UTF-8 or if the decoded string is not valid NestedText.