Package org.tomlj

Class TomlBindError

java.lang.Object
org.tomlj.TomlBindError
All Implemented Interfaces:
Serializable

public final class TomlBindError extends Object implements Serializable
A value of a TOML document that could not be bound to its Java type.
See Also:
  • Method Details

    • path

      public String path()
      The path of the value within the table or array that was bound.

      The path is a dotted key, with [i] after the key of an array for its element at index i, such as servers[1].host. It is empty for the table or array that was bound.

      Returns:
      The path of the value.
    • message

      public String message()
      What is wrong with the value, such as expected an integer, found a string.
      Returns:
      A description of the error, without the path or position.
    • position

      public @Nullable TomlPosition position()
      The position of the value in the TOML document.

      For an unknown key, this is the position of the key, and for a missing key, the position of the table the key is missing from: its header, or the start of the document for the root table of a document.

      Returns:
      The position, or null if the value, or the table for a missing key, was not read from a document.
    • cause

      public @Nullable Throwable cause()
      The exception that caused this error.

      An exception thrown by a record's constructor or by a converter is reported as an error with its message, and kept here. The cause is not part of the error's equality or its string form.

      Returns:
      The exception thrown, or null if the error was found by binding itself.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object