Skip to content

Null validators

These answer existence vs applicability questions.

Null — Should be null

Used for

Declaring that a value must not be set in this context.

How it works

  • Passes only if value is null

What it will find

  • Intentionally empty values

What it will not find

  • Empty strings
  • Zero values
  • False booleans

Null — Should not be null

Used for

Mandatory-value enforcement.

How it works

  • Fails if value resolves to null

What it will find

  • Missing or unresolved values

What it will not find

  • Empty-but-present values (unless explicitly checked)