A has an associated lower bound (null or a key).
A has an associated upper bound (null or a key).
A has an associated lower open flag. Unless otherwise stated it is unset.
A key range has an associated upper open flag. Unless otherwise stated it is unset.
A may have a lower bound its upper bound. A must not have a lower bound its upper bound.
A containing only key has both lower bound and equal to key.
The lower bound is null, or it is key, or it is both equal to key and the is unset.
The upper bound is null, or it is key, or it is both equal to key and the is unset.
If the lower open flag of a is unset, the lower bound of the key range is included in the range itself.
If the of a key range is unset, the key of the is included in the range itself.
If the upper open flag of a is set, the upper bound of the key range is excluded from the range itself.
The steps to convert a value to a key range with value and optional null disallowed flag are as follows:
If value is a , return value.
Let key be the result of running the steps to convert a value to a key with value. Rethrow any exceptions.
If key is invalid, a ““ .
Return a key range key.