<Default Package>
Type boolean
Boolean type.
The boolean type has two possible values: true and false. The default value is false.
Booleans are routable in an event, they are acyclic, they can be parsed and they are comparable.
false sorts before true.
Booleans support the following operators:
= | Compare two booleans for equality |
!= | Compare two booleans for inequality |
or | Boolean (logical) or |
and | Boolean (logical) and |
xor | Boolean (logical) xor |
not | Boolean (logical) not |
canParse
boolean static canParse(string s)
Check if the string argument can be successfully parsed as a boolean.- Parameters:
- s - The string to test for parseability.
- Returns:
- True if the string could be parsed as a boolean, false otherwise.
- See Also:
- - See the parse method for how booleans are parsed.
- - See the string type for an alternative way to convert strings to booleans.
parse
boolean static parse(string s)
Parse a string as a boolean.
Valid arguments are either "true" or "false" in any capitalization.- Parameters:
- s - The string to parse as a boolean.
- Returns:
- The boolean corresponding to the string.
- Throws:
- Throws ParseException if the argument cannot be parsed.
hash
integer hash()
Get an integer hash representation of the underlying object.
This function will return an integer evenly distributed over the whole range suitable for partitioning or indexing of that structure. Multiple different object can resolve to the same hash value.- Returns:
- An integer respresentation of the underlying object.
toString
string toString()
Convert this boolean to a string.- Returns:
- "true" if this boolean is true, otherwise "false".