Class Keys

java.lang.Object
org.instancio.settings.Keys

public final class Keys extends Object
Defines all keys supported by Instancio.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final SettingKey
    Specifies the default value of the AfterGenerate hint supplied from custom generators to the engine; default is AfterGenerate.POPULATE_NULLS_AND_DEFAULT_PRIMITIVES; property name hint.after.generate.
    static final SettingKey
    Specifies whether a null can be generated for array elements; default is false; property name array.elements.nullable.
    static final SettingKey
    Specifies maximum length for arrays; default is 6; property name array.max.length.
    static final SettingKey
    Specifies minimum length for arrays; default is 2; property name array.min.length.
    static final SettingKey
    Specifies whether a null can be generated for arrays; default is false; property name array.nullable.
    static final SettingKey
    Specifies whether a null can be generated for Boolean type; default is false; property name boolean.nullable.
    static final SettingKey
    Specifies maximum value for bytes; default is 127; property name byte.max.
    static final SettingKey
    Specifies minimum value for bytes; default is 1; property name byte.min.
    static final SettingKey
    Specifies whether a null can be generated for Byte type; default is false; property name byte.nullable.
    static final SettingKey
    Specifies whether a null can be generated for Character type; default is false; property name character.nullable.
    static final SettingKey
    Specifies whether a null can be generated for collection elements; default is false; property name collection.elements.nullable.
    static final SettingKey
    Specifies maximum size for collections; default is 6; property name collection.max.size.
    static final SettingKey
    Specifies minimum size for collections; default is 2; property name collection.min.size.
    static final SettingKey
    Specifies whether a null can be generated for collections; default is false; property name collection.nullable.
    static final SettingKey
    Specifies maximum value for doubles; default is 10000; property name double.max.
    static final SettingKey
    Specifies minimum value for doubles; default is 1; property name double.min.
    static final SettingKey
    Specifies whether a null can be generated for Double type; default is false; property name double.nullable.
    static final SettingKey
    Specifies maximum value for floats; default is 10000; property name float.max.
    static final SettingKey
    Specifies minimum value for floats; default is 1; property name float.min.
    static final SettingKey
    Specifies whether a null can be generated for Float type; default is false; property name float.nullable.
    static final SettingKey
    Specifies maximum value for integers; default is 10000; property name integer.max.
    static final SettingKey
    Specifies minimum value for integers; default is 1; property name integer.min.
    static final SettingKey
    Specifies whether a null can be generated for Integer type; default is false; property name integer.nullable.
    static final SettingKey
    Specifies maximum value for longs; default is 10000; property name long.max.
    static final SettingKey
    Specifies minimum value for longs; default is 1; property name long.min.
    static final SettingKey
    Specifies whether a null can be generated for Long type; default is false; property name long.nullable.
    static final SettingKey
    Specifies whether a null can be generated for map keys; default is false; property name map.keys.nullable.
    static final SettingKey
    Specifies maximum size for maps; default is 6; property name map.max.size.
    static final SettingKey
    Specifies minimum size for maps; default is 2; property name map.min.size.
    static final SettingKey
    Specifies whether a null can be generated for maps; default is false; property name map.nullable.
    static final SettingKey
    Specifies whether a null can be generated for map values; default is false; property name map.values.nullable.
    static final SettingKey
    Specifies the mode: strict (unused selectors will trigger an exception) or lenient; default is strict; property name mode.
    static final SettingKey
    Specifies whether initialised fields are allowed to be overwritten; default is true; property name overwrite.existing.values.
    static final SettingKey
    Specifies the seed value; default is null; property name seed.
    static final SettingKey
    Specifies maximum value for shorts; default is 10000; property name short.max.
    static final SettingKey
    Specifies minimum value for shorts; default is 1; property name short.min.
    static final SettingKey
    Specifies whether a null can be generated for Short type; default is false; property name short.nullable.
    static final SettingKey
    Specifies whether an empty string can be generated; default is false; property name string.allow.empty.
    static final SettingKey
    Specifies maximum length of strings; default is 10; property name string.max.length.
    static final SettingKey
    Specifies minimum length of strings; default is 3; property name string.min.length.
    static final SettingKey
    Specifies whether a null can be generated for String type; default is false; property name string.nullable.
  • Method Summary

    Modifier and Type
    Method
    Description
    all()
    Returns all keys supported by Instancio.
    static SettingKey
    get(@NotNull String key)
    Returns a SettingKey instance with the given property key.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ARRAY_ELEMENTS_NULLABLE

      public static final SettingKey ARRAY_ELEMENTS_NULLABLE
      Specifies whether a null can be generated for array elements; default is false; property name array.elements.nullable.
    • ARRAY_MAX_LENGTH

      public static final SettingKey ARRAY_MAX_LENGTH
      Specifies maximum length for arrays; default is 6; property name array.max.length.
    • ARRAY_MIN_LENGTH

      public static final SettingKey ARRAY_MIN_LENGTH
      Specifies minimum length for arrays; default is 2; property name array.min.length.
    • ARRAY_NULLABLE

      public static final SettingKey ARRAY_NULLABLE
      Specifies whether a null can be generated for arrays; default is false; property name array.nullable.
    • BOOLEAN_NULLABLE

      public static final SettingKey BOOLEAN_NULLABLE
      Specifies whether a null can be generated for Boolean type; default is false; property name boolean.nullable.
    • BYTE_MAX

      public static final SettingKey BYTE_MAX
      Specifies maximum value for bytes; default is 127; property name byte.max.
    • BYTE_MIN

      public static final SettingKey BYTE_MIN
      Specifies minimum value for bytes; default is 1; property name byte.min.
    • BYTE_NULLABLE

      public static final SettingKey BYTE_NULLABLE
      Specifies whether a null can be generated for Byte type; default is false; property name byte.nullable.
    • CHARACTER_NULLABLE

      public static final SettingKey CHARACTER_NULLABLE
      Specifies whether a null can be generated for Character type; default is false; property name character.nullable.
    • COLLECTION_ELEMENTS_NULLABLE

      public static final SettingKey COLLECTION_ELEMENTS_NULLABLE
      Specifies whether a null can be generated for collection elements; default is false; property name collection.elements.nullable.
    • COLLECTION_MAX_SIZE

      public static final SettingKey COLLECTION_MAX_SIZE
      Specifies maximum size for collections; default is 6; property name collection.max.size.
    • COLLECTION_MIN_SIZE

      public static final SettingKey COLLECTION_MIN_SIZE
      Specifies minimum size for collections; default is 2; property name collection.min.size.
    • COLLECTION_NULLABLE

      public static final SettingKey COLLECTION_NULLABLE
      Specifies whether a null can be generated for collections; default is false; property name collection.nullable.
    • DOUBLE_MAX

      public static final SettingKey DOUBLE_MAX
      Specifies maximum value for doubles; default is 10000; property name double.max.
    • DOUBLE_MIN

      public static final SettingKey DOUBLE_MIN
      Specifies minimum value for doubles; default is 1; property name double.min.
    • DOUBLE_NULLABLE

      public static final SettingKey DOUBLE_NULLABLE
      Specifies whether a null can be generated for Double type; default is false; property name double.nullable.
    • FLOAT_MAX

      public static final SettingKey FLOAT_MAX
      Specifies maximum value for floats; default is 10000; property name float.max.
    • FLOAT_MIN

      public static final SettingKey FLOAT_MIN
      Specifies minimum value for floats; default is 1; property name float.min.
    • FLOAT_NULLABLE

      public static final SettingKey FLOAT_NULLABLE
      Specifies whether a null can be generated for Float type; default is false; property name float.nullable.
    • INTEGER_MAX

      public static final SettingKey INTEGER_MAX
      Specifies maximum value for integers; default is 10000; property name integer.max.
    • INTEGER_MIN

      public static final SettingKey INTEGER_MIN
      Specifies minimum value for integers; default is 1; property name integer.min.
    • INTEGER_NULLABLE

      public static final SettingKey INTEGER_NULLABLE
      Specifies whether a null can be generated for Integer type; default is false; property name integer.nullable.
    • LONG_MAX

      public static final SettingKey LONG_MAX
      Specifies maximum value for longs; default is 10000; property name long.max.
    • LONG_MIN

      public static final SettingKey LONG_MIN
      Specifies minimum value for longs; default is 1; property name long.min.
    • LONG_NULLABLE

      public static final SettingKey LONG_NULLABLE
      Specifies whether a null can be generated for Long type; default is false; property name long.nullable.
    • MAP_KEYS_NULLABLE

      public static final SettingKey MAP_KEYS_NULLABLE
      Specifies whether a null can be generated for map keys; default is false; property name map.keys.nullable.
    • MAP_MAX_SIZE

      public static final SettingKey MAP_MAX_SIZE
      Specifies maximum size for maps; default is 6; property name map.max.size.
    • MAP_MIN_SIZE

      public static final SettingKey MAP_MIN_SIZE
      Specifies minimum size for maps; default is 2; property name map.min.size.
    • MAP_NULLABLE

      public static final SettingKey MAP_NULLABLE
      Specifies whether a null can be generated for maps; default is false; property name map.nullable.
    • MAP_VALUES_NULLABLE

      public static final SettingKey MAP_VALUES_NULLABLE
      Specifies whether a null can be generated for map values; default is false; property name map.values.nullable.
    • MODE

      public static final SettingKey MODE
      Specifies the mode: strict (unused selectors will trigger an exception) or lenient; default is strict; property name mode.
      Since:
      1.3.3
    • AFTER_GENERATE_HINT

      public static final SettingKey AFTER_GENERATE_HINT
      Specifies the default value of the AfterGenerate hint supplied from custom generators to the engine; default is AfterGenerate.POPULATE_NULLS_AND_DEFAULT_PRIMITIVES; property name hint.after.generate.
      Since:
      2.0.0
    • OVERWRITE_EXISTING_VALUES

      public static final SettingKey OVERWRITE_EXISTING_VALUES
      Specifies whether initialised fields are allowed to be overwritten; default is true; property name overwrite.existing.values.
      Since:
      2.0.0
    • SEED

      public static final SettingKey SEED
      Specifies the seed value; default is null; property name seed.
      Since:
      1.5.1
    • SHORT_MAX

      public static final SettingKey SHORT_MAX
      Specifies maximum value for shorts; default is 10000; property name short.max.
    • SHORT_MIN

      public static final SettingKey SHORT_MIN
      Specifies minimum value for shorts; default is 1; property name short.min.
    • SHORT_NULLABLE

      public static final SettingKey SHORT_NULLABLE
      Specifies whether a null can be generated for Short type; default is false; property name short.nullable.
    • STRING_ALLOW_EMPTY

      public static final SettingKey STRING_ALLOW_EMPTY
      Specifies whether an empty string can be generated; default is false; property name string.allow.empty.
    • STRING_MAX_LENGTH

      public static final SettingKey STRING_MAX_LENGTH
      Specifies maximum length of strings; default is 10; property name string.max.length.
    • STRING_MIN_LENGTH

      public static final SettingKey STRING_MIN_LENGTH
      Specifies minimum length of strings; default is 3; property name string.min.length.
    • STRING_NULLABLE

      public static final SettingKey STRING_NULLABLE
      Specifies whether a null can be generated for String type; default is false; property name string.nullable.
  • Method Details

    • all

      public static List<SettingKey> all()
      Returns all keys supported by Instancio.
      Returns:
      all keys
    • get

      public static SettingKey get(@NotNull @NotNull String key)
      Returns a SettingKey instance with the given property key.
      Parameters:
      key - to lookup
      Returns:
      the setting key; an exception is thrown if the key is not found