Enum Nullability

    • Enum Constant Detail

      • NULL

        public static final Nullability NULL
        Value is definitely null
      • NOT_NULL

        public static final Nullability NOT_NULL
        Value is definitely not null
      • UNKNOWN

        public static final Nullability UNKNOWN
        Value may be null or not null
      • BOTTOM

        public static final Nullability BOTTOM
        Bottom - no information (unreachable)
    • Method Detail

      • values

        public static Nullability[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Nullability c : Nullability.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Nullability 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
      • join

        public Nullability join​(Nullability other)
        Merges two states at a dataflow confluence, widening to UNKNOWN when they disagree.
        Parameters:
        other - the state to join with
        Returns:
        the merged state
      • meet

        public Nullability meet​(Nullability other)
        Narrows two states, falling to BOTTOM when they disagree.
        Parameters:
        other - the state to meet with
        Returns:
        the narrowed state
      • mayBeNull

        public boolean mayBeNull()
        Returns:
        true for NULL or UNKNOWN
      • mayBeNonNull

        public boolean mayBeNonNull()
        Returns:
        true for NOT_NULL or UNKNOWN
      • isDefinitelyNull

        public boolean isDefinitelyNull()
        Returns:
        true only for NULL
      • isDefinitelyNotNull

        public boolean isDefinitelyNotNull()
        Returns:
        true only for NOT_NULL