ParseableBoolean

com.phasmidsoftware.gryphon.parse.Parseable.ParseableBoolean
See theParseableBoolean companion trait

Provides an implicit implementation of the Parseable typeclass for the Boolean type.

This object defines a method to parse a String into a Boolean value using the toBooleanOption method. It is used as an implicit instance where the Parseable[Boolean] is required.

Parsing accepts strings like "true" or "false" (case-insensitive) and returns an Option containing the corresponding Boolean value if successful.

Extends the ParseableBoolean trait, which provides the parsing logic for the Boolean type.

Attributes

Companion
trait
Graph
Supertypes
trait Parseable[Boolean]
class Object
trait Matchable
class Any
Self type

Members list

Value members

Inherited methods

def message: String

Provides a message describing the type supported by this implementation.

Provides a message describing the type supported by this implementation.

Attributes

Returns

A string representation of the type, in this case "Boolean".

Inherited from:
ParseableBoolean
def none: Boolean

Returns a default value of type T.

Returns a default value of type T.

Attributes

Returns

the default value of type T, typically representing an "empty" or "none" state.

Inherited from:
ParseableBoolean
def parse(w: String): Try[Boolean]

Parses the input string into an Option[Boolean] based on its content. The method interprets the string as a boolean value ("true" or "false") and returns it as an Option. If the string cannot be interpreted as a valid boolean, the method returns None.

Parses the input string into an Option[Boolean] based on its content. The method interprets the string as a boolean value ("true" or "false") and returns it as an Option. If the string cannot be interpreted as a valid boolean, the method returns None.

Value parameters

w

The input string to parse into a boolean value.

Attributes

Returns

An Option[Boolean] containing Some(true) or Some(false) if parsing is successful, or None if the string is not a valid representation of a boolean.

Inherited from:
ParseableBoolean
def regex: Regex

The regular expression used for parsing a Parseable[T].

The regular expression used for parsing a Parseable[T].

Attributes

Returns

A compiled regular expression. By default, the result matches one or more word characters (\w+).

Inherited from:
ParseableBoolean