Class InternalKey

java.lang.Object
org.instancio.internal.settings.InternalKey
All Implemented Interfaces:
Comparable<SettingKey>, SettingKey

public final class InternalKey extends Object implements SettingKey
  • Constructor Details

    • InternalKey

      public InternalKey(String propertyKey, Class<?> type, @Nullable @Nullable Object defaultValue, @Nullable @Nullable RangeAdjuster rangeAdjuster, boolean allowsNullValue)
  • Method Details

    • propertyKey

      public String propertyKey()
      Description copied from interface: SettingKey
      A property key that can be used to configure this setting in a properties file.
      Specified by:
      propertyKey in interface SettingKey
      Returns:
      property key
    • type

      public <T> Class<T> type()
      Description copied from interface: SettingKey
      Type of the property value.
      Specified by:
      type in interface SettingKey
      Returns:
      value class
    • defaultValue

      public <T> T defaultValue()
      Description copied from interface: SettingKey
      Default value for this key.
      Specified by:
      defaultValue in interface SettingKey
      Type Parameters:
      T - type of the value
      Returns:
      default value
    • allowsNullValue

      public boolean allowsNullValue()
      Description copied from interface: SettingKey
      Indicates whether the value for this key can be set to null.
      Specified by:
      allowsNullValue in interface SettingKey
      Returns:
      true if null is allowed, false otherwise
    • autoAdjust

      public <T extends Number & Comparable<T>> void autoAdjust(@NotNull @NotNull Settings settings, @NotNull T otherValue)
      Description copied from interface: SettingKey
      Auto-adjusts the Settings value for this key based on the value of another setting key.
      Specified by:
      autoAdjust in interface SettingKey
      Parameters:
      settings - to adjust
      otherValue - value of the other setting to base the adjustment off
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(SettingKey o)
      Specified by:
      compareTo in interface Comparable<SettingKey>
    • toString

      public String toString()
      Overrides:
      toString in class Object