Class InternalSettings

java.lang.Object
org.instancio.internal.settings.InternalSettings
All Implemented Interfaces:
Settings

public final class InternalSettings extends Object implements Settings
  • Method Details

    • create

      public static InternalSettings create()
      Description copied from interface: Settings
      Creates a new instance of empty settings.
      Returns:
      empty settings
    • defaults

      public static InternalSettings defaults()
      Description copied from interface: Settings
      Creates a new instance containing default settings.
      Returns:
      settings containing defaults
    • from

      public static InternalSettings from(Map<Object,Object> map)
      Description copied from interface: Settings
      Create settings from the given map.
      Parameters:
      map - to create settings from
      Returns:
      settings
    • from

      public static InternalSettings from(Settings other)
      Description copied from interface: Settings
      Create settings from the given settings.
      Parameters:
      other - settings to create settings from
      Returns:
      a new instance of settings
    • merge

      public InternalSettings merge(@Nullable @Nullable Settings other)
      Description copied from interface: Settings
      Creates a new instance of settings by merging given settings with these settings.
      Specified by:
      merge in interface Settings
      Parameters:
      other - settings to merge
      Returns:
      new instance of merged settings
    • get

      public <T> T get(@NotNull @NotNull SettingKey key)
      Description copied from interface: Settings
      Get setting value for given key.
      Specified by:
      get in interface Settings
      Type Parameters:
      T - setting value type
      Parameters:
      key - setting key
      Returns:
      value for given key, or null if none.
    • set

      public InternalSettings set(@NotNull @NotNull SettingKey key, @Nullable @Nullable Object value)
      Description copied from interface: Settings
      Set the setting with the given key to the specified value.

      Note: when updating range settings (such as Keys.COLLECTION_MIN_SIZE and Keys.COLLECTION_MAX_SIZE), range bounds are auto-adjusted by Constants.RANGE_ADJUSTMENT_PERCENTAGE if the new minimum is higher than the current maximum, and vice versa.

      Specified by:
      set in interface Settings
      Parameters:
      key - to set
      value - to set
      Returns:
      updated settings
    • mapType

      public InternalSettings mapType(@NotNull @NotNull Class<?> from, @NotNull @NotNull Class<?> to)
      Description copied from interface: Settings
      Map 'from' supertype to 'to' subtype.
      Specified by:
      mapType in interface Settings
      Parameters:
      from - supertype class
      to - subtype class
      Returns:
      updated settings
    • getSubtypeMap

      public Map<Class<?>,Class<?>> getSubtypeMap()
      Description copied from interface: Settings
      Returns a read-only view of the subtype map.
      Specified by:
      getSubtypeMap in interface Settings
      Returns:
      subtype map
    • lock

      public InternalSettings lock()
      Description copied from interface: Settings
      Locks these settings for further modifications, making this instance immutable.
      Specified by:
      lock in interface Settings
      Returns:
      read-only settings
    • toString

      public String toString()
      Overrides:
      toString in class Object