ParseableInt

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

An implicit object that provides a specific implementation of the Parseable[Int] typeclass. This object allows for parsing string inputs into optional integer values using the parse method.

It serves as an instance of the ParseableInt trait and automatically provides parsing capabilities for Int type values wherever an implicit Parseable[Int] is required.

The parsing functionality uses the toIntOption method for the conversion, which returns Some[Int] if the input string represents a valid integer, or None otherwise.

Attributes

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

Members list

Value members

Inherited 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.

Inherited from:
ParseableInt
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.

Inherited from:
ParseableInt
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.

Inherited from:
ParseableInt
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.

Inherited from:
ParseableInt