NB5 Docs► Reference Section► Binding Functions▼ null functions 🖺

These functions can generate null values. When using nulls in your binding recipes, ensure that you don't generate them in-line as inputs to other functions. This will lead to errors which interrupt your test. If you must use functions that generate null values, ensure that they are the only or last function in a chain.

If you need to mark a field to be undefined, but not set to null, then use the functions which know how to yield a VALUE.UNSET, which is a sigil constant within the VirtData runtime. These functions are correctly interpreted by conformant drivers like the SQL driver so that they will avoid inject the named field into an operation if it has this special value.

NullIfCloseTo

Returns null if the input value is within range of the specified value.

NullIfEmpty

Yields a null if the input String is empty. Throws an error if the input String is null.

NullIfEq

Yeilds a null if the input value is equal to the specified value.

NullIfGe

Yields a null if the input value is greater tha or equal to the specified value.

NullIfGt

Yields a null if the input value is greater than the specified value.

NullIfLe

Yields a null if the input value is less than or equal to the specified value.

NullIfLt

Yields a null if the input value is equal to the specified value.

NullIfNullOrEmpty

Yield a null value if the input String is either null or empty.

NullIfWithin

Yields a null if the input value is within the specified range, inclusive.

NullOrLoad

Reads a long variable from the input, hashes and scales it to the unit interval 0.0d - 1.0d, then uses the result to determine whether to return null object or a loaded value.

NullOrPass

Reads a long variable from the thread local variable map, hashes and scales it to the unit interval 0.0d - 1.0d, then uses the result to determine whether to return a null object or the input value.

Unset

Always yields the VALUE.unset value, which signals to any consumers that the value provided should be considered undefined for any operation. This is distinct from functions which return a null, which is considered an actual value to be acted upon. It is deemed an error for any downstream user of this library to do anything with VALUE.unset besides explicitly acting like it wasn't provided. That is the point of VALUE.unset. The purpose of having such a value in this library is to provide a value type to help bridge between functional flows and imperative run-times. Without such a value, it would be difficult to simulate value streams in which some of the time values are set and other times they are not.

UnsetIfCloseTo

Yield VALUE.unset if the input value is close to the specified value by the sigma threshold. Otherwise, pass the input value along.

UnsetIfEmpty

Yield VALUE.unset if the input String is empty. Throws an error if the input value is null. Otherwise, passes the original value along.

UnsetIfEq

Yield UNSET.vale if the input value is equal to the specified value. Otherwise, pass the input value along.

UnsetIfGe

Yield VALUE.unset if the input value is greater than or equal to the specified value. Otherwise, pass the input value along.

UnsetIfGt

Yield UNSET.value if the input value is greater than the specified value. Otherwise, pass the input value along.

UnsetIfLe

Yield VALUE.unset if the input value is less than or equal to the specified value. Otherwise, pass the value along.

UnsetIfLt

Yield VALUE.unset if the provided value is less than the specified value, otherwise, pass the original value;

UnsetIfNullOrEmpty

Yields UNSET.value if the input value is null or empty. Otherwise, passes the original value along.

UnsetIfStringEq

Yields UNSET.value if the input value is equal to the specified value. Throws an error if the input value is null. Otherwise, passes the original value along.

UnsetIfStringNe

Yields UNSET.value if the input String is not equal to the specified String value. Throws an error if the input value is null. Otherwise, passes the original value along.

UnsetIfWithin

Yields UNSET.value if the input value is within the specified range, inclusive. Otherwise, passes the original value along.

UnsetOrLoad

Reads a long variable from the input, hashes and scales it to the unit interval 0.0d - 1.0d, then uses the result to determine whether to return UNSET.value or a loaded value.

UnsetOrPass

Reads a long variable from the thread local variable map, hashes and scales it to the unit interval 0.0d - 1.0d, then uses the result to determine whether to return UNSET.value or the input value.

Back to top