Skip to main content

isPresent

isPresent(value: T) : Bool for any type T.

Returns true if a value is non-null and false otherwise. (Values like [], "", 0 and false are not equal to null and return true.)

Examples:

  • isPresent("") returns true
  • isPresent(0) returns true
  • isPresent(null: Integer) returns false
  • foreach l in network.locations select {x: isPresent(l.city)} returns true for each city in network.locations that has a value, and false if the city is undefined.

See also

Functions

Data Model