class

Bool

@Serializable { simple=true }
const class Bool : Obj

Bool represents a boolean condition of true or false.

constructors fromStr

Parse a Str into a Bool

fields defVal

Default value is false

methods toStr

Return "true" or "false"

not

Return the logical not

toLocale

Return localized strings for "true" and "false" using current locale

or

Bitwise "or" of this and b

and

Bitwise "and" of this and b

toCode

Get this Bool as a Fantom code literal - returns toStr

equals

Return if same boolean value

xor

Bitwise "exclusive-or" of this and b

hash

Return 1231 for true and 1237 for false

and Bool and(Bool b)

Bitwise "and" of this and b. Note this method does not short circuit like logical && operator.

defVal const static Bool : defVal

Default value is false.

equals virtual Bool equals(Obj? obj)

Return if same boolean value.

fromStr static new fromStr(Str s, Bool checked)

Parse a Str into a Bool. Valid formats are "true" or "false". If invalid format and checked is false return null, otherwise throw ParseErr.

hash virtual Int hash()

Return 1231 for true and 1237 for false.

not Bool not()

Return the logical not: if true return false; if false return true.

or Bool or(Bool b)

Bitwise "or" of this and b. Note this method does not short circuit like logical || operator.

toCode Str toCode()

Get this Bool as a Fantom code literal - returns toStr.

toLocale Str toLocale()

Return localized strings for "true" and "false" using current locale.

toStr virtual Str toStr()

Return "true" or "false".

xor Bool xor(Bool b)

Bitwise "exclusive-or" of this and b.

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST