Danger<V extends Object, E extends Exception> class
sealed
Result との違いは E が Object ではなく Exception であること.
成功もしくは失敗の可能性があることを示す型.
V で void を指定したい場合, 代わりに Complete を指定する.
Properties
- asError → Never
-
Caution
no setteroverride
- asException → E
-
Caution
no setteroverride
- asExpected → V
-
Caution
no setterinherited
- hashCode → int
-
properties に依存.
no setterinherited
- log → Log
-
no setterinherited
-
properties
→ Map<
String, Object> -
inactivate(), = operator, [] operator, など に依存されている.
no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- wrapped → Object
-
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toInactivatedJson(
) → Map< String, dynamic> -
test 時に 等価比較が行えるように 一部の property 値を無効化する(一定の値に変更する)処理を加えた json を出力する.
例えば process id など, system によって割り振られる値をこちらで指定できないので このような場合に利用する.
inherited -
toJson(
) → Map< String, dynamic> -
ここでの toJson とは json へ encode 可能な形式へ変換するという意味で使われる.
つまり json string を返すというわけではない.
また serialize としても利用するため deserialize 可能でなければならない.
inherited -
toNestedStructureMap(
) → Map< String, Object> -
条件分岐で利用するため用意した.
inherited
-
toString(
) → String -
properties に依存.
inherited
Operators
-
operator ==(
Object other) → bool -
instance properties の toString() をそれぞれ比較し合う。
properties, [] operator に依存.
inherited
-
operator [](
String key) → Object -
properties から、operator == の内容を自動更新できるようにするために定義している.
inherited
Static Methods
-
fromDanger<
V extends Object, E extends Exception> (Danger< V, E> danger, [Log? log]) → Danger<V, E> -
throwOut<
RT extends Object, ET extends Exception, BET extends Exception> (Danger< RT, BET> danger, Error error, [Log? log, Map<String, dynamic> monitorOnError = const {}]) → Danger<RT, ET> -
RT...return type
ET...exception type
BET...base exception type
-
tryAndCatch<
RT extends Object, ET extends Exception> (RT tryAction(), Log log) → Danger< RT, ET> -
RT...return type
ET...exception type
-
tryAndCatchFuture<
RT extends Object, ET extends Exception> (Future< RT> tryAction(), Log log) → FutureDanger<RT, ET> -
RT...return type
ET...exception type