PublicationTry<SuccessT> class

Subclass of Try<SuccessT, UserException> that is useful when parsing a Publication.

Inheritance
  • Object
  • Try<SuccessT, UserException>
  • PublicationTry

Constructors

PublicationTry.failure(UserException failure)
PublicationTry.success(SuccessT success)

Properties

failure → UserException?
finalinherited
hashCode int
The hash code for this object.
no setterinherited
isFailure bool
no setterinherited
isSuccess bool
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
success → SuccessT?
finalinherited

Methods

exceptionOrNull() → UserException?
Returns the encapsulated Throwable exception if this instance represents failure or null if it is success. */
inherited
flatMap<R>(Try<R, UserException> transform(SuccessT value)) → Try<R, UserException>
inherited
getOrElse(SuccessT onFailure(UserException)) → SuccessT
inherited
getOrNull() → SuccessT?
Returns the encapsulated value if this instance represents success or null if it is failure. */
inherited
getOrThrow() → SuccessT
Returns the encapsulated value if this instance represents success or throws the encapsulated Throwable exception if it is failure.
inherited
map<R>(R transform(SuccessT value)) → Try<R, UserException>
Returns the encapsulated result of the given transform function applied to the encapsulated value if this instance represents success or the original encapsulated Throwable exception if it is failure.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onFailure(void action(UserException)) → Try<SuccessT, UserException>
Performs the given action on the encapsulated Throwable exception if this instance represents failure. Returns the original Try unchanged.
inherited
onSuccess(void action(SuccessT)) → Try<SuccessT, UserException>
Performs the given action on the encapsulated value if this instance represents success. Returns the original Try unchanged.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited