Class: FieldParseResult

FieldParseResult()

Result container for field-level parsing operations. Encapsulates the result of parsing a single field, distinguishing between successful results with values and failed results with errors. Either getResult() or getError() will be non-null, but not both.

Constructor

new FieldParseResult()

Source:

Methods

getError() → {Error|null}

Get the parsing error if one occurred.
Source:
Returns:
The error or null if parsing succeeded
Type
Error | null

getResult() → {*|null}

Get the parsed result value.
Source:
Returns:
The parsed value or null if parsing failed
Type
* | null

hasError() → {boolean}

Check if parsing resulted in an error.
Source:
Returns:
True if an error occurred
Type
boolean

(static) failure(error)

Create a failed field parse result.
Parameters:
Name Type Description
error Error The error that occurred during parsing
Source:

(static) success(result)

Create a successful field parse result.
Parameters:
Name Type Description
result * The successfully parsed value
Source: