fromByteOrNull

fun fromByteOrNull(number: Byte): Zero?

Creates an instance of Zero from the specified number, or returns null if calling the fromByte function with the number throws an IllegalArgumentException.


Calling from Kotlin

Here's an example of calling this function from Kotlin code:

val number: Byte = 0
val zero: Zero? = Zero.fromByteOrNull(number)
assertNotNull(zero)

This function is not available from Java code due to its non-explicit support for nullable types.

See the fromByte function for throwing an exception instead of returning null in case of invalid number.