Class Key

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

public final class Key extends Object implements SettingKey
  • Method Details

    • propertyKey

      public String propertyKey()
      Description copied from interface: SettingKey
      A property key used in the 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
    • autoAdjust

      public <T extends Number & Comparable<T>> void autoAdjust(Settings settings, 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