Package dev.frostlake.values
Class VariantBooleans
java.lang.Object
dev.frostlake.values.VariantBooleans
A VARIANT converted to BOOLEAN — by
::BOOLEAN, CAST or TO_BOOLEAN — on the account's terms: it
converts only when it holds a boolean. A JSON boolean is itself, a JSON null (or an absent value) is
NULL, and a JSON string is read the way TO_BOOLEAN reads text ('yes', 'F', '1',
trimmed, any case). Every other value fails the row with Failed to cast variant value <text> to
BOOLEAN, a number included — though a SQL NUMBER converts, a variant one does not — and so does a string
that is no boolean spelling, quoted as the variant holds it (all live-verified).-
Method Summary
-
Method Details
-
convert
- Parameters:
value- the variant- Returns:
- its boolean, or null for a JSON null
-