Package org.jooq

Enum Nullability

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Nullability>

    public enum Nullability
    extends java.lang.Enum<Nullability>
    An enum that specifies the nullability of a DataType.
    Author:
    Lukas Eder
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      DEFAULT
      Default behaviour for data types.
      NOT_NULL
      The data type is explicitly not nullable.
      NULL
      The data type is explicitly nullable.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean nullable()
      Whether this nullability encodes an explicitly or implicitly nullable type.
      static Nullability of​(boolean nullability)
      Get the explicit Nullability corresponding to a boolean value.
      static Nullability valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Nullability[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NOT_NULL

        @Support
        public static final Nullability NOT_NULL
        The data type is explicitly not nullable.
      • DEFAULT

        @Support
        public static final Nullability DEFAULT
        Default behaviour for data types.

        The interpretation of this value depends on the context in which a DataType is used:

        • CREATE TABLE: The data type is implicitly nullable (or explicitly, if the underlying database does not support implicit nullability or defaults to implicit non-nullability).
        • ALTER TABLE .. ALTER COLUMN .. SET TYPE: The data type's nullability will not be modified by jOOQ (but it may well be modified by the database, e.g. SQLDialect.MYSQL or SQLDialect.SQLSERVER).
    • 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​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • of

        public static Nullability of​(boolean nullability)
        Get the explicit Nullability corresponding to a boolean value.
      • nullable

        public boolean nullable()
        Whether this nullability encodes an explicitly or implicitly nullable type.