类 ConfigureSource<SECTION extends ConfigureSection,ORIGINAL,SELF extends ConfigureSource<SECTION,ORIGINAL,SELF>>

java.lang.Object
cc.carm.lib.configuration.source.section.ConfigureSource<SECTION,ORIGINAL,SELF>
类型参数:
SECTION - The type of the root section.
ORIGINAL - The original configuration object.
SELF - The type of the source itself, for further implement support.
所有已实现的接口:
ConfigureSection
直接已知子类:
FileConfigSource

public abstract class ConfigureSource<SECTION extends ConfigureSection,ORIGINAL,SELF extends ConfigureSource<SECTION,ORIGINAL,SELF>> extends Object implements ConfigureSection
ConfigureSource represents the source of configuration, which can be a file, a database, or any other source.
另请参阅:
  • 字段详细资料

  • 构造器详细资料

    • ConfigureSource

      protected ConfigureSource(@NotNull @NotNull ConfigurationHolder<? extends SELF> holder, long lastUpdateMillis)
  • 方法详细资料

    • holder

      @NotNull public @NotNull ConfigurationHolder<? extends SELF> holder()
    • reload

      public void reload() throws Exception
      抛出:
      Exception
    • self

      @Contract(pure=true) @Internal @NotNull protected abstract SELF self()
    • original

      @Contract(pure=true) @NotNull public abstract ORIGINAL original()
      返回:
      The original configuration object.
    • section

      @NotNull public abstract SECTION section()
      返回:
      The root ConfigureSection, which represents the entire configuration.
    • save

      public abstract void save() throws Exception
      Save the whole configuration.
      抛出:
      Exception - If any error occurs while saving.
    • onReload

      @OverrideOnly protected abstract void onReload() throws Exception
      Reload the configuration.
      This used for implementation, for external usage, use reload()
      抛出:
      Exception - If any error occurs while reloading.
    • pathSeparator

      public char pathSeparator()
      从接口复制的说明: ConfigureSection
      Get the path separator for the section.
      指定者:
      pathSeparator 在接口中 ConfigureSection
      返回:
      The path separator
    • getLastUpdateMillis

      public long getLastUpdateMillis()
    • isExpired

      public boolean isExpired(long parsedTime)
    • parent

      @Contract(pure=true, value="->null") @Nullable public @Nullable ConfigureSection parent()
      Source also represents the root section, so it has no parent
      指定者:
      parent 在接口中 ConfigureSection
      返回:
      null
    • path

      @NotNull public @NotNull String path()
      从接口复制的说明: ConfigureSection
      Get the current section's path from ConfigureSection.parent() of this section.
      指定者:
      path 在接口中 ConfigureSection
      返回:
      The current path of this section, if ConfigureSection.isRoot(), return empty string.
    • getValues

      @NotNull public @NotNull Map<String,Object> getValues(boolean deep)
      从接口复制的说明: ConfigureSection
      Gets a set containing all values in this section.

      If deep is set to true, then this will contain all the keys within any child ConfigureSections (and their children paths).

      If deep is set to false, then this will contain only the keys of any direct children, and not their own children.

      指定者:
      getValues 在接口中 ConfigureSection
      参数:
      deep - Whether to get a deep list.
      返回:
      Map of data values contained within this Section.
    • getKeys

      @NotNull public @NotNull @UnmodifiableView Set<String> getKeys(boolean deep)
      从接口复制的说明: ConfigureSection
      Gets a set containing all keys in this section.

      If deep is set to true, then this will contain all the keys within any child ConfigureSections (and their children paths).

      If deep is set to false, then this will contain only the keys of any direct children, and not their own children.

      指定者:
      getKeys 在接口中 ConfigureSection
      参数:
      deep - Whether to get a deep list.
      返回:
      Set of keys contained within this Section.
    • asMap

      @NotNull public @NotNull @UnmodifiableView Map<String,Object> asMap()
      从接口复制的说明: ConfigureSection
      Get this section as a map.

      In this map, child ConfigureSections will also be represented as Maps.

      指定者:
      asMap 在接口中 ConfigureSection
      返回:
      Map of data values contained within this Section.
    • createSection

      @NotNull public @NotNull ConfigureSection createSection(@NotNull @NotNull String path, @NotNull @NotNull Map<?,?> data)
      从接口复制的说明: ConfigureSection
      Creates a new ConfigureSection with specified values.

      The ConfigureSection.parent() of the new section will be this section.

      This section will not be saved until ConfigureSection.set(String, Object) is called.

      If you want to create and use a section and set it to this section, use ConfigureSection.computeSection(String).

      指定者:
      createSection 在接口中 ConfigureSection
      data - The data to be used to create section.
      返回:
      Newly created section
    • set

      public void set(@NotNull @NotNull String path, @Nullable @Nullable Object value)
      从接口复制的说明: ConfigureSection
      Sets the value at the given path.

      Null values will be kept, if you want to remove a value use ConfigureSection.remove(String) Path separator depends on holder's StandardOptions.PATH_SEPARATOR

      指定者:
      set 在接口中 ConfigureSection
      参数:
      path - The path to set the value at.
      value - The value to set.
    • remove

      public void remove(@NotNull @NotNull String path)
      从接口复制的说明: ConfigureSection
      Removes the value at the given path.

      Path separator depends on holder's StandardOptions.PATH_SEPARATOR

      指定者:
      remove 在接口中 ConfigureSection
      参数:
      path - The path to remove the value at.
    • get

      @Nullable public @Nullable Object get(@NotNull @NotNull String path)
      从接口复制的说明: ConfigureSection
      Get the origin value of the path.
      指定者:
      get 在接口中 ConfigureSection
      参数:
      path - The path to get the value from.
      返回:
      The value at the path, or null if not found.