Class ConfigManager

java.lang.Object
org.polyfrost.oneconfig.api.config.v1.ConfigManager

public final class ConfigManager extends Object
  • Field Details

    • PROFILES_DIR

      public static final Path PROFILES_DIR
    • PROFILE_LOCAL_METADATA

      public static final String PROFILE_LOCAL_METADATA
      See Also:
  • Method Details

    • addProfileChangeListener

      public static void addProfileChangeListener(ConfigManager.ProfileChangeListener listener)
    • profileDir

      public static Path profileDir(String profile)
    • internal

      @Internal public static ConfigManager internal()
      Returns a reference to the internal config manager, which is mounted onto the ./OneConfig directory.
    • backup

      @Internal public static ConfigManager backup()
      Returns a reference to config manager which contains the backup configs, which is mounted onto the ./OneConfig/backup directory. internal use only!
      used for the restore to default buttons.
    • active

      public static ConfigManager active()
      Returns a reference to the active config manager, which is mounted to the current active profile.
    • initialize

      @Internal public static void initialize()
    • submitForInitialization

      @Internal public static void submitForInitialization(Config config)
    • openProfile

      public static void openProfile(String profile)
    • activeProfile

      public static String activeProfile()
    • profiles

      public static List<String> profiles()
    • createProfile

      public static void createProfile(String profile)
    • renameProfile

      public static void renameProfile(String profile, String newProfile)
    • deleteProfile

      public static void deleteProfile(String profile)
    • favoriteProfiles

      public static List<String> favoriteProfiles()
    • isFavoriteProfile

      public static boolean isFavoriteProfile(String profile)
    • setFavoriteProfile

      public static void setFavoriteProfile(String profile, boolean favorite)
    • profileIcons

      public static Map<String,String> profileIcons()
    • profileIcon

      public static String profileIcon(String profile)
    • setProfileIcon

      public static void setProfileIcon(String profile, @Nullable @Nullable String icon)
    • isFirstRun

      public static boolean isFirstRun()
    • core

      @Internal public static ConfigManager core()
      Returns a reference to the core config manager, which is mounted onto the ./config directory. internal use only!
    • collect

      @Internal public static org.polyfrost.oneconfig.api.config.v1.Tree collect(@NotNull @NotNull Object o, @NotNull @NotNull String id)
    • registerCollector

      public static void registerCollector(org.polyfrost.oneconfig.api.config.v1.collect.PropertyCollector collector)
      Register a collector that can be used to collect trees from objects. these are shared between all config managers.
    • trees

      public @UnmodifiableView Collection<org.polyfrost.oneconfig.api.config.v1.Tree> trees()
    • load

      @Nullable public @Nullable org.polyfrost.oneconfig.api.config.v1.Tree load(String id)
    • get

      public org.polyfrost.oneconfig.api.config.v1.Tree get(String id)
    • getNoRegister

      @Internal public org.polyfrost.oneconfig.api.config.v1.Tree getNoRegister(Path p) throws Exception
      Throws:
      Exception
    • save

      public boolean save(String id)
    • save

      public boolean save(org.polyfrost.oneconfig.api.config.v1.Tree t)
    • saveAll

      public void saveAll()
    • getFolder

      public Path getFolder()
    • register

      public org.polyfrost.oneconfig.api.config.v1.backend.Backend.RegistrationResult register(org.polyfrost.oneconfig.api.config.v1.Tree t)
    • delete

      public boolean delete(String id)
    • gatherAll

      @Internal public Collection<org.polyfrost.oneconfig.api.config.v1.Tree> gatherAll(String sub)
    • register

      public org.polyfrost.oneconfig.api.config.v1.Tree register(@NotNull @NotNull Object o, @NotNull @NotNull String id)