Enum Class JSType.Nullability
- All Implemented Interfaces:
Serializable,Comparable<JSType.Nullability>,Constable
- Enclosing class:
JSType
Specifies how to express nullability of reference types in annotation strings and error
messages. Note that this only applies to the outer-most type. Nullability of generic type
arguments is always explicit.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic JSType.NullabilityReturns the enum constant of this class with the specified name.static JSType.Nullability[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EXPLICIT
Include an explicit '!' for non-nullable reference types. This is suitable for use in most type contexts (particularly 'type', 'param', and 'return' annotations). -
IMPLICIT
Omit the explicit '!' from the outermost non-nullable reference type. This is suitable for use in cases where a single reference type is expected (e.g. 'extends' and 'implements').
-
-
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
-