Failure

Represents a failure result in the context of a result model.

This class is a concrete implementation of the Result sealed interface, specifically used to represent a failure case. It contains an error message that can be used to describe the failure or provide additional context about the error.

Parameters

TResult

The type parameter representing the type of the result in successful cases.

Constructors

Link copied to clipboard
constructor(message: String)

Properties

Link copied to clipboard
open override val content: String

Provides access to the error message associated with the failure result. Retrieves the content as a string representation of the error message.

Link copied to clipboard

A string containing the error message or details about the failure.

Functions

Link copied to clipboard

Casts the current Result instance to a Failure type.

Link copied to clipboard

Casts the current Result instance to Success<TResult>.

Link copied to clipboard
open fun isFailure(): Boolean

Checks whether the current instance represents a failure result.

Link copied to clipboard
open fun isSuccessful(): Boolean

Determines whether the current Result instance represents a successful outcome.