ParseableInt

com.phasmidsoftware.gryphon.parse.Parseable.ParseableInt
See theParseableInt companion object
trait ParseableInt extends Parseable[Int]

A trait that provides a specialized implementation of the Parseable typeclass for parsing strings into non-negative integer (Int) values.

Classes or objects implementing this trait can parse a string input and convert it into an Option[Int], where Some(value) represents a successfully parsed integer, and None indicates a failed parsing attempt.

This trait extends Parseable[Int], inheriting its generic parsing behavior for the Int type.

Attributes

Companion
object
Graph
Supertypes
trait Parseable[Int]
class Object
trait Matchable
class Any
Known subtypes
object ParseableInt

Members list

Value members

Concrete methods

def message: String

Retrieves a string representation of the type Int.

Retrieves a string representation of the type Int.

Attributes

Returns

A string value "Int" that represents the type.

def none: Int

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.

def parse(input: String): Try[Int]

Parses a string input and attempts to convert it into an optional value of type Int.

Parses a string input and attempts to convert it into an optional value of type Int.

Value parameters

input

The string to be parsed into an object of type Int.

Attributes

Returns

An Option containing the parsed object of type Int if successful, or None if the parsing fails.

def regex: Regex

Provides a regular expression pattern for matching one or more digits that represent a non-negative integer.

Provides a regular expression pattern for matching one or more digits that represent a non-negative integer.

Attributes

Returns

A Regex object representing the regular expression \d+, which matches any sequence of one or more digits.