Bool
@Serializable { simple=true }
const class Bool : Obj
Bool represents a boolean condition of true or false.
Parse a Str into a Bool
Default value is false
Bitwise "and" of this and b
Return if same boolean value
Return 1231 for true and 1237 for false
Return the logical not
Bitwise "or" of this and b
Get this Bool as a Fantom code literal - returns toStr
Return localized strings for "true" and "false" using current locale
Return "true" or "false"
Bitwise "exclusive-or" of this and b
Bool and(Bool b)
Bitwise "and" of this and b. Note this method does not
short circuit like logical && operator.
const static Bool : defVal
Default value is false.
virtual Bool equals(Obj? obj)
Return if same boolean value.
static new fromStr(Str s, Bool checked := true)
Parse a Str into a Bool. Valid formats are "true" or "false". If invalid format and checked is false return null, otherwise throw ParseErr.
virtual Int hash()
Return 1231 for true and 1237 for false.
Bool not()
Return the logical not: if true return false; if false return true.
Bool or(Bool b)
Bitwise "or" of this and b. Note this method does not
short circuit like logical || operator.
Str toCode()
Get this Bool as a Fantom code literal - returns toStr.
Str toLocale()
Return localized strings for "true" and "false" using current locale.
virtual Str toStr()
Return "true" or "false".
Bool xor(Bool b)
Bitwise "exclusive-or" of this and b.