Package org.tomlj

Class EmptyTomlTable

java.lang.Object
org.tomlj.EmptyTomlTable
All Implemented Interfaces:
TomlTable

final class EmptyTomlTable extends Object implements TomlTable
  • Field Details

    • EMPTY_TABLE

      static final TomlTable EMPTY_TABLE
  • Constructor Details

    • EmptyTomlTable

      private EmptyTomlTable()
  • Method Details

    • size

      public int size()
      Description copied from interface: TomlTable
      Return the number of entries in tis table.
      Specified by:
      size in interface TomlTable
      Returns:
      The number of entries in tis table.
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: TomlTable
      true if there are no entries in this table.
      Specified by:
      isEmpty in interface TomlTable
      Returns:
      true if there are no entries in this table.
    • keySet

      public Set<String> keySet()
      Description copied from interface: TomlTable
      Get the keys of this table.

      The returned set contains only immediate keys to this table, and not dotted keys or key paths. For a complete view of keys available in the TOML document, use TomlTable.dottedKeySet() or TomlTable.keyPathSet().

      Specified by:
      keySet in interface TomlTable
      Returns:
      A set containing the keys of this table.
    • keyPathSet

      public Set<List<String>> keyPathSet(boolean includeTables)
      Description copied from interface: TomlTable
      Get all the paths in this table.
      Specified by:
      keyPathSet in interface TomlTable
      Parameters:
      includeTables - If true, also include paths to intermediary and empty tables.
      Returns:
      A set containing all the key paths of this table.
    • entrySet

      public Set<Map.Entry<String,Object>> entrySet()
      Description copied from interface: TomlTable
      Get the entries of this table.

      The returned set contains only immediate entries of this table, and not entries with dotted keys or key paths. For a complete view of all entries available in the TOML document, use TomlTable.dottedEntrySet() or TomlTable.entryPathSet().

      Specified by:
      entrySet in interface TomlTable
      Returns:
      A set containing the immediate entries of this table.
    • entryPathSet

      public Set<Map.Entry<List<String>,Object>> entryPathSet(boolean includeTables)
      Description copied from interface: TomlTable
      Get all the entries in this table.
      Specified by:
      entryPathSet in interface TomlTable
      Parameters:
      includeTables - If true, also include entries in intermediary and empty tables.
      Returns:
      A set containing all the entries of this table.
    • get

      public @Nullable Object get(List<String> path)
      Description copied from interface: TomlTable
      Get a value from the TOML document.
      Specified by:
      get in interface TomlTable
      Parameters:
      path - The key path.
      Returns:
      The value, or null if no value was set in the TOML document.
    • inputPositionOf

      public @Nullable TomlPosition inputPositionOf(List<String> path)
      Description copied from interface: TomlTable
      Get the position where a key is defined in the TOML document.
      Specified by:
      inputPositionOf in interface TomlTable
      Parameters:
      path - The key path.
      Returns:
      The input position, or null if the key was not set in the TOML document.
    • toMap

      public Map<String,Object> toMap()
      Description copied from interface: TomlTable
      Get the elements of this array as a Map.

      Note that this does not do a deep conversion. If this array contains tables or arrays, they will be of type TomlTable or TomlArray respectively.

      Specified by:
      toMap in interface TomlTable
      Returns:
      The elements of this array as a Map.