Returns an array of Integer or null if the input is null. Null is intentional (not empty list), to be
able to distinguish between null value and empty list in the db.
162940
public static List<Integer> getIntegerList(final ResultSet rs, final String columnName) throws SQLException
    {
        final Array ary = rs.getArray(columnName);
        if (ary != null) {
            Preconditions.checkArgument(ary.getBaseType() == Types.INTEGER || ary.getBaseType() == Types.SMALLINT);
            return Arrays.asList((Integer []) ary.getArray());
        }
        return null;
    }
620347
private String getIntegerString(Number value)
   {
      return (value == null ? null : Integer.toString(value.intValue()));
   }
176089
public boolean isNull()
    {   // Return true if all non null fields have data in them
        int fieldCount = this.getFieldCount();  // BaseField Count
        for (int fieldSeq = DBConstants.MAIN_FIELD; fieldSeq < fieldCount+DBConstants.MAIN_FIELD; fieldSeq++)
        {
            BaseField field = this.getField(fieldSeq);
            if ((!field.isNullable()) && (field.isNull()))
                return true;            // This field can't be null!!!
        }
        return false;   // All fields okay
    }
74575
public int nullity() {
        if( is64 ) {
            return SingularOps_DDRM.nullity((SingularValueDecomposition_F64)svd, 10.0 * UtilEjml.EPS);
        } else {
            return SingularOps_FDRM.nullity((SingularValueDecomposition_F32)svd, 5.0f * UtilEjml.F_EPS);
        }
    }
869819
public TerminalResult IS_NULL() {
		getPredicateExpression().setOperator(Operator.IS_NULL);
		TerminalResult ret = APIAccess.createTerminalResult(this.getPredicateExpression());
		QueryRecorder.recordInvocation(this, "IS_NULL", ret);
		return ret;
	}
263102
public function nulls() {
		$prefix = '';
		$tables = $this->_getTables($prefix);

		$todo = [];

		$db = $this->_getConnection();

		$this->out('Checking for tables that need updating:', 1, static::VERBOSE);
		foreach ($tables as $table) {
			// Structure
			$sql = 'DESCRIBE ' . $table['table_name'] . ';';
			$this->out('- ' . $sql, 1, static::VERBOSE);
			/** @var \Traversable $res */
			$res = $db->query($sql);
			$fields = (new Collection($res))->toArray();

			$fieldList = [];
			foreach ($fields as $field) {
				$name = $field['Field'];
				if ($name === 'id' || substr($name, -3) === '_id') {
					continue;
				}

				$type = $field['Type'];
				$null = $field['Null'];

				if (preg_match('/^tinyint\([\d]\)/', $type)) {
					if ($null === 'YES' || $field['Default'] !== null) {
						continue;
					}

					$todo[] = 'ALTER TABLE' . ' ' . $table['table_name'] . ' CHANGE `' . $name . '` `' . $name . '` ' . $type . ' NOT NULL DEFAULT \'0\';';

					continue;
				}

				if (!in_array($type, ['longtext', 'mediumtext', 'text']) && !preg_match('/^(varchar|char)\(/', $type)) {
					continue;
				}
				if ($type === 'varchar(36)' || $type === 'char(36)') {
					continue;
				}

				$fieldList[] = $field['Field'];

				if ($null === 'YES' || $field['Default'] !== null) {
					continue;
				}

				// We need to migrate sth
				if (!in_array($type, ['longtext', 'mediumtext', 'text'])) {
					$todo[] = 'ALTER TABLE' . ' ' . $table['table_name'] . ' CHANGE `' . $name . '` `' . $name . '` ' . $type . ' NOT NULL DEFAULT \'\';';
				} else {
					$todo[] = 'ALTER TABLE' . ' ' . $table['table_name'] . ' CHANGE `' . $name . '` `' . $name . '` ' . $type . ' DEFAULT NULL;';
				}
			}
		}

		if (!$todo) {
			$this->out('Nothing to do :)');
			return;
		}

		$this->out(count($todo) . ' tables/fields need updating.');
		if (!$this->param('dry-run')) {
			$continue = $this->in('Continue?', ['y', 'n'], 'y');
			if ($continue !== 'y') {
				$this->abort('Aborted!');
			}
		}
		$sql = implode(PHP_EOL, $todo);
		if (!$this->param('dry-run')) {
			$this->out($sql);
			return;
		}

		$db->query($sql);
		$this->out('Done :)');
	}
85642
@SuppressWarnings("unchecked")
	public static <T> T firstNonNull(T... array) {
		if (isNotEmpty(array)) {
			for (final T val : array) {
				if (null != val) {
					return val;
				}
			}
		}
		return null;
	}
529381
public function asNull(): Primitive\NullType
    {
        if (!$this->_element instanceof Primitive\NullType) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_NULL));
        }
        return $this->_element;
    }
1336698
public static String getNullAsValue(String input, String value) {
    return (input == null) ? value : input;
  }
895970
private int getIntValue(String str, int defaultValue) {

        try {
            int intValue = Integer.parseInt(str);
            return (intValue > 0) ? intValue : defaultValue;
        } catch (NumberFormatException e) {
            // intentionally left blank
        }
        return defaultValue;
    }
108809
Integer getNumPrecRadix() {

        switch (type) {

            case Types.SQL_BIGINT :
            case Types.SQL_DECIMAL :
            case Types.SQL_INTEGER :
            case Types.SQL_NUMERIC :
            case Types.SQL_SMALLINT :
            case Types.TINYINT :
                return ValuePool.getInt(10);

            case Types.SQL_FLOAT :
            case Types.SQL_DOUBLE :
            case Types.SQL_REAL :
                return ValuePool.getInt(2);

            default :
                return null;
        }
    }
217714
public static IntStream ofNullable(int[] nullable) {
        return null == nullable ? IntStream.empty() : Arrays.stream(nullable);
    }
420686
private Integer getNullOnValue(Integer value, int nullValue)
   {
      return (NumberHelper.getInt(value) == nullValue ? null : value);
   }
192614
public static String[] removeNull(String[] in) {
        if (in == null) {
            return new String[0];
        }
        ArrayList<String> arr = new ArrayList();
        for (int i = 0; i < in.length; i++) {
            if (in[i] != null) {
                arr.add(in[i]);
            }
        }
        if (in.length == arr.size()) {
            return in;
        } else {
            return arr.toArray(new String[0]);
        }
    }
710584
protected static Integer getSingleIntegerParam(List<String> list) {
        String s = getSingleParam(list);
        if (s != null) {
            try {
                return Integer.valueOf(s);
            } catch (NumberFormatException e) {
                return null;
            }
        }
        return null;
    }
574189
@Nullable
    private Integer processArrayElementStore() {
        if (stack.getStackDepth() >= 2) {
            OpcodeStack.Item itm = stack.getStackItem(2);
            int reg = itm.getRegisterNumber();
            if (reg != -1) {
                WrapperInfo wi = wrappers.get(Integer.valueOf(reg));
                if (wi != null) {
                    OpcodeStack.Item elItm = stack.getStackItem(0);
                    wi.wrappedReg = elItm.getRegisterNumber();
                }
            } else {
                OpcodeStack.Item elItm = stack.getStackItem(0);
                reg = elItm.getRegisterNumber();
                if (reg != -1) {
                    return Integer.valueOf(reg);
                }
            }
        }

        return null;
    }
505756
def to_nullable_array(value):
        
        # Shortcuts
        if value == None:
            return None
        if type(value) == list:
            return value 

        if type(value) in [tuple, set]:
            return list(value)
            
        return [value]