Enum Class Nullness
- All Implemented Interfaces:
Serializable, Comparable<Nullness>, Constable, org.checkerframework.errorprone.dataflow.analysis.AbstractValue<Nullness>
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionReturns theNullnessthat corresponds to what you can deduce by knowing that some expression is not equal to another expression with thisNullness.greatestLowerBound(Nullness other) leastUpperBound(Nullness other) toString()static NullnessReturns the enum constant of this class with the specified name.static Nullness[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NULLABLE
The lattice for nullness looks like:Nullable / \ Null Non-null \ / Bottom -
NULL
-
NONNULL
-
BOTTOM
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
leastUpperBound
-
greatestLowerBound
-
deducedValueWhenNotEqual
Returns theNullnessthat corresponds to what you can deduce by knowing that some expression is not equal to another expression with thisNullness.A
Nullnessrepresents a set of possible values for a expression. Suppose you have two variablesvar1andvar2. Ifvar1 != var2, thenvar1must be an element of the complement of the singleton set containing the value ofvar2. If you union these complement sets over all possible values ofvar2, the set that results is what this method returns, assuming thatthisis theNullnessofvar2.Example 1: Suppose
nv2 == NULL. Thenvar2can have exactly one value,null, andvar1must have a value in the set of all values exceptnull. That set is exactlyNONNULL.Example 2: Suppose
nv2 == NONNULL. Thenvar2can have any value exceptnull. Supposevar2has value"foo". Thenvar1must have a value in the set of all values except"foo". Now supposevar2has value"bar". Thenvar1must have a value in set of all values except"bar". Since we don't know which value in the setNONNULL var2has, we union all possible complement sets to get the set of all values, orNULLABLE. -
toString
-