java.lang.Object
com.mrivanplays.annotationconfig.core.resolver.settings.LoadSettings

public final class LoadSettings extends Object
Represents load settings. They are used upon annotated config load.
Since:
2.0.0
Author:
MrIvanPlays
  • Method Details

    • newBuilder

      Creates a new empty LoadSettings.Builder
      Returns:
      empty builder instance
    • newBuilder

      public static LoadSettings.Builder newBuilder(boolean fromDefaults)
      Creates a new LoadSettings.Builder
      Parameters:
      fromDefaults - whether to instantiate load settings from getDefault()
      Returns:
      builder instance
    • empty

      public static LoadSettings empty()
      Creates new empty load settings. If used unmodified on a ConfigResolver, the config resolver will fall back to the default settings (a.ka getDefault()).
      Returns:
      empty load settings
    • getDefault

      public static LoadSettings getDefault()
      Returns the default load settings.
      Returns:
      defaults
    • get

      public <T> Optional<T> get(LoadSetting<T> setting)
      Returns the value held for the specified LoadSetting setting
      Type Parameters:
      T - value type
      Parameters:
      setting - the load setting you want the value for
      Returns:
      load setting value optional, which can be empty
    • set

      public <T> void set(LoadSetting<T> setting, T value)
      Binds the specified value to the specified LoadSetting setting. If the load setting already has a value, it gets replaced.
      Type Parameters:
      T - value type
      Parameters:
      setting - the load setting you want the value to be bound to
      value - the value you want bound
    • copy

      public LoadSettings copy()
      Creates a copy of the current load settings
      Returns:
      copy