class RetrievalStatusResult
Class RetrievalStatusResult
protected Result
|
$res |
public static
|
RetrievalStatusResult |
ok(RetrievalStatus $value)
|
No description | |
public static
|
RetrievalStatusResult |
err(Exception $err)
|
No description | |
public
|
bool |
isOk()
|
No description | |
public
|
bool |
isError()
|
No description | |
public
|
RetrievalStatus |
value()
|
No description | |
public
|
Exception|null |
getErr()
|
No description | |
public
|
RetrievalStatus|mixed |
valueOr(mixed $fallback)
|
No description |
ok()
public static RetrievalStatusResult ok(RetrievalStatus $value)
err()
public static RetrievalStatusResult err(Exception $err)
isOk()
public bool isOk()
bool |
isError()
public bool isError()
bool |
value()
public RetrievalStatus value()
Exception|null |
valueOr()
public RetrievalStatus|mixed valueOr(mixed $fallback)
<?php
namespace LibMVault\Result;
use LibMVault\RetrievalStatus;
/**
* Class RetrievalStatusResult
* @package LibMVault\Result
*/
class RetrievalStatusResult {
/**
* @var Result
*/
protected $res;
/**
* RetrievalStatusResult constructor.
* @param Result $res
*/
private function __construct(Result $res) {
$this->res = $res;
}
/**
* @param RetrievalStatus $value
* @return RetrievalStatusResult
*/
public static function ok(RetrievalStatus $value): RetrievalStatusResult {
return new RetrievalStatusResult(Result::ok($value));
}
/**
* @param \Exception $err
* @return RetrievalStatusResult
*/
public static function err(\Exception $err): RetrievalStatusResult {
return new RetrievalStatusResult(Result::err($err));
}
/**
* @return bool
*/
public function isOk(): bool {
return $this->res->isOk();
}
/**
* @return bool
*/
public function isError(): bool {
return $this->res->isError();
}
/**
* @return RetrievalStatus
* @throws \Exception
*/
public function value(): RetrievalStatus {
return $this->res->value();
}
/**
* @return \Exception|null
*/
public function getErr() {
return $this->res->getErr();
}
/**
* @param mixed $fallback
* @return RetrievalStatus|mixed
*/
public function valueOr($fallback) {
return $this->res->valueOr($fallback);
}
}