ParseableString

com.phasmidsoftware.gryphon.parse.Parseable.ParseableString
See theParseableString companion trait

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

This object defines a mechanism for parsing a string input into an optional String value. It enables type-safe and consistent string parsing in contexts where the Parseable typeclass is used.

Attributes

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

Members list

Value members

Inherited methods

def message: String

Retrieves a predefined string message.

Retrieves a predefined string message.

Attributes

Returns

A string message, "String".

Inherited from:
ParseableString
def none: String

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:
ParseableString
def parse(input: String): Try[String]

Parses the input string and returns an optional string based on the validity of the input. If the input string is non-null and non-empty, it is wrapped in an Option and returned. Otherwise, None is returned.

Parses the input string and returns an optional string based on the validity of the input. If the input string is non-null and non-empty, it is wrapped in an Option and returned. Otherwise, None is returned.

Value parameters

input

the input string to parse. It can be null or empty.

Attributes

Returns

an Option[String] containing the input string if it is non-null and non-empty, or None otherwise.

Inherited from:
ParseableString
def regex: Regex

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

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

Attributes

Returns

A compiled regular expression. The result matches one or more word characters (\w+).

Inherited from:
ParseableString