Module bus.setting

Class Setting

java.lang.Object
org.miaixz.bus.setting.metric.setting.Setting

public class Setting extends Object
A utility class that provides static methods for accessing Setting configuration files, with caching support.
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • Setting

      public Setting()
  • Method Details

    • get

      public static Setting get(String name)
      Gets a cached Setting instance for the given resource name. If the name has no extension, .setting is assumed. The file is loaded from the classpath.
      Parameters:
      name - The name of the settings file.
      Returns:
      The cached or newly loaded Setting instance.
    • getFirstFound

      public static Setting getFirstFound(String... names)
      Gets the first Setting instance that can be successfully loaded from a list of resource names. It tries each name in order until one is found.
      Parameters:
      names - The resource names to try. If a name has no extension, .setting is assumed.
      Returns:
      The first found Setting instance, or null if none are found.