Enum Class Nullability

java.lang.Object
java.lang.Enum<Nullability>
org.axonframework.common.nullability.Nullability
All Implemented Interfaces:
Serializable, Comparable<Nullability>, Constable

@Internal public enum Nullability extends Enum<Nullability>
The declared nullability of a Parameter, as reported by a NullabilityResolver.

This is deliberately three-valued. Absence of a Nullable annotation is not evidence that a parameter is non-null, since most Java code carries no nullability annotations at all. A resolver that cannot form an opinion therefore reports UNKNOWN rather than NON_NULL, allowing lower-priority resolvers to answer and letting the caller apply its own default.

Marked Internal as it forms part of the NullabilityResolver contract.

Since:
5.3.0
Author:
Mateusz Nowak
See Also:
  • Enum Constant Details

    • NULLABLE

      public static final Nullability NULLABLE
      The parameter is explicitly declared as accepting null.
    • NON_NULL

      public static final Nullability NON_NULL
      The parameter is explicitly declared as not accepting null.
    • UNKNOWN

      public static final Nullability UNKNOWN
      No nullability could be determined for the parameter.
  • Method Details

    • values

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

      public static Nullability valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null