Interface TomlValue

All Known Subinterfaces:
TomlArray, TomlDocument, TomlPrimitive, TomlTable

@NonExtendable public interface TomlValue
A TOML primitive, array or table. Explicit casts should not be performed. Instead, use asPrimitive(), asArray() or asTable().
  • Method Details

    • copyOf

      @Contract("_ -> new") @AvailableSince("0.6.4") @NotNull static @NotNull TomlValue copyOf(@NotNull @NotNull TomlValue other)
      Returns a deep copy of the provided value
      See Also:
    • creationTime

      @AvailableSince("1.3.0") long creationTime()
      Reports the time that this object was created as reported by System.nanoTime().
    • flags

      @Internal @AvailableSince("1.2.1") int flags()
      Reports the flags stored on this value. Flags are opaque to consumers but have internal meaning required for spec-compliant reading.
    • flags

      @Internal @AvailableSince("1.2.1") @Contract("_ -> this") @NotNull @NotNull TomlValue flags(int flags)
      Sets the flags stored on this value. Flags are opaque to consumers but have internal meaning required for spec-compliant reading.
    • comments

      @AvailableSince("0.6.0") @NotNull @NotNull Comments comments()
      Accesses the comments stored on this value
    • isPrimitive

      default boolean isPrimitive()

      Returns true if the value represents a primitive and asPrimitive() may be called.

      The return value of this method may or may not be identical to this instanceof TomlPrimitive.

    • asPrimitive

      @NotNull default @NotNull TomlPrimitive asPrimitive() throws UnsupportedOperationException
      Converts this value to a primitive. Whether the method returns this or not is an implementation detail.
      Throws:
      UnsupportedOperationException - Value does not represent a primitive (see isPrimitive())
    • isArray

      default boolean isArray()

      Returns true if the value represents a array and asArray() may be called.

      The return value of this method may or may not be identical to this instanceof TomlArray.

    • asArray

      @NotNull default @NotNull TomlArray asArray() throws UnsupportedOperationException
      Converts this value to a array. Whether the method returns this or not is an implementation detail.
      Throws:
      UnsupportedOperationException - Value does not represent an array (see isArray())
    • isTable

      default boolean isTable()

      Returns true if the value represents a table and asTable() may be called.

      The return value of this method may or may not be identical to this instanceof TomlTable.

    • asTable

      @NotNull default @NotNull TomlTable asTable() throws UnsupportedOperationException
      Converts this value to a table. Whether the method returns this or not is an implementation detail.
      Throws:
      UnsupportedOperationException - Value does not represent a table (see isTable())