Method Expect
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
Expect(Exception)
Gets the Optional's value, or throws the provided exception if it's empty.
public T Expect(Exception err)
Parameters
err
ExceptionThe exception to throw if the optional is empty.
Returns
- T
The value of the Optional, if present.
Expect(string)
Gets the Optional's value, or throws a standard exception with the provided string if it's empty.
public T Expect(string str)
Parameters
str
stringThe string provided to the exception.
Returns
- T
The value of the Optional, if present.