Enum OnSetFieldError

java.lang.Object
java.lang.Enum<OnSetFieldError>
org.instancio.settings.OnSetFieldError
All Implemented Interfaces:
Serializable, Comparable<OnSetFieldError>, java.lang.constant.Constable

@ExperimentalApi public enum OnSetFieldError extends Enum<OnSetFieldError>
A setting that specifies what should happen if an error occurs when setting a field's value.
Since:
2.1.0
See Also:
  • Enum Constant Details

    • FAIL

      public static final OnSetFieldError FAIL
      Propagate the error up by throwing InstancioApiException.
      Since:
      2.1.0
    • IGNORE

      public static final OnSetFieldError IGNORE
      Ignore the error and continue populating the object.

      Warning: an error caused by assigning an incompatible type is considered a user error and is never ignored.

      Since:
      2.1.0
  • Method Details

    • values

      public static OnSetFieldError[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static OnSetFieldError valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<OnSetFieldError>