Enum Class JSType.Nullability

java.lang.Object
java.lang.Enum<JSType.Nullability>
com.google.javascript.rhino.jstype.JSType.Nullability
All Implemented Interfaces:
Serializable, Comparable<JSType.Nullability>, Constable
Enclosing class:
JSType

public static enum JSType.Nullability extends Enum<JSType.Nullability>
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.
  • Enum Constant Details

    • EXPLICIT

      public static final JSType.Nullability 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

      public static final JSType.Nullability 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

      public static JSType.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 JSType.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