Class UnmodifiableConfigWrapper<C extends UnmodifiableConfig>

java.lang.Object
com.electronwill.nightconfig.core.utils.UnmodifiableConfigWrapper<C>
All Implemented Interfaces:
UnmodifiableConfig
Direct Known Subclasses:
ConfigWrapper, FakeUnmodifiableCommentedConfig

public abstract class UnmodifiableConfigWrapper<C extends UnmodifiableConfig> extends Object implements UnmodifiableConfig
  • Field Details

  • Constructor Details

    • UnmodifiableConfigWrapper

      protected UnmodifiableConfigWrapper(C config)
  • Method Details

    • getRaw

      public <T> T getRaw(List<String> path)
      Description copied from interface: UnmodifiableConfig
      Gets a value from the config. Doesn't convert NullObject.NULL_OBJECT to null.
      Specified by:
      getRaw in interface UnmodifiableConfig
      Type Parameters:
      T - the value's type
      Parameters:
      path - the value's path, each element of the list is a different part of the path.
      Returns:
      the value at the given path, or null if there is no such value.
    • valueMap

      public Map<String,Object> valueMap()
      Description copied from interface: UnmodifiableConfig
      Returns a Map view of the config's values. If the config is unmodifiable then the returned map is unmodifiable too.
      Specified by:
      valueMap in interface UnmodifiableConfig
      Returns:
      a Map view of the config's values.
    • entrySet

      public Set<? extends UnmodifiableConfig.Entry> entrySet()
      Description copied from interface: UnmodifiableConfig
      Returns a Set view of the config's entries. If the config is unmodifiable then the returned set is unmodifiable too.
      Specified by:
      entrySet in interface UnmodifiableConfig
      Returns:
      a Set view of the config's entries.
    • contains

      public boolean contains(List<String> path)
      Description copied from interface: UnmodifiableConfig
      Checks if the config contains a value at some path.
      Specified by:
      contains in interface UnmodifiableConfig
      Parameters:
      path - the path to check, each element of the list is a different part of the path.
      Returns:
      true if the path is associated with a value, false if it's not.
    • size

      public int size()
      Description copied from interface: UnmodifiableConfig
      Gets the size of the config.
      Specified by:
      size in interface UnmodifiableConfig
      Returns:
      the number of top-level elements in the config.
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: UnmodifiableConfig
      Checks if the config is empty.
      Specified by:
      isEmpty in interface UnmodifiableConfig
      Returns:
      true if the config is empty, false if it contains at least one element.
    • equals

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

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

      public ConfigFormat<?> configFormat()
      Description copied from interface: UnmodifiableConfig
      Returns the config's format.
      Specified by:
      configFormat in interface UnmodifiableConfig
      Returns:
      the config's format