/* * Copyright 2020 Magnus Madsen * * Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE.md file. */////// Functions for working with Java objects and `null` values.///pubmod Object {import java.util.Objectsimport java.lang.Object////// Returns `true` if the given value `x` is `null`.///@InlinepubdefisNull(x: a): Bool =matchReflect.reflectValue(x) {case Reflect.JvmValue.JvmObject(obj) => Objects.isNull(obj)case_ => false }////// Returns `None` if the given value `x` is `null`, otherwise returns `Some(x)`.///pubdeftoOption(x: a): Option[a] =if (isNull(x)) None else Some(x)}