Result<V extends Object, E extends Exception> class
sealed
成功もしくは失敗の可能性があることを示す型.
V で void を指定したい場合, 代わりに Complete を指定する.
Constructors
-
Result.fromResult(Result<
V, E> result, Type? classLocation, String? functionLocation, Map<String, dynamic> monitor, Map<String, dynamic> debug, Iterable<Log> histories) -
syntax sugar.
factory
-
Result.wrapException(E wrapExceptionFactory(Exception exception), Result<
V, Exception> result, Type? classLocation, String? functionLocation, Map<String, dynamic> monitor, Map<String, dynamic> debug, Iterable<Log> histories) -
syntax sugar.
factory
Properties
- asError → E?
-
no setter
- asValue → V?
-
no setter
- classLocation → String
-
finalinherited
-
debug
→ Map<
String, dynamic> -
開発時のみに記録する data.
finalinherited
- errorType → Type
-
no setter
- functionLocation → String
-
finalinherited
- hashCode → int
-
toMap() に依存.
no setterinherited
- historyList → HistoryList
-
finalinherited
- location → String
-
no setterinherited
-
message
→ List<
String> -
no setterinherited
-
monitor
→ Map<
String, dynamic> -
本番時および開発時に記録する data.
finalinherited
- resultType → Type
-
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- valueType → Type
-
no setter
- wrapped → Object
-
no setterinherited
Methods
-
change(
{Type? classLocation, String? functionLocation, Map< String, dynamic> ? monitor, Map<String, dynamic> ? debug, Iterable<Log> ? histories}) → Log -
inherited
-
inactivate(
) → Map< String, Object> -
test で等価性を判断する時に 無効にしたい場合に利用する.
無効化された値を返す.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object> -
inherited
-
toMap(
) → Map< String, Object> -
定義例:
inherited
-
toMapShortHand(
) → Map< String, dynamic> -
LogSetting.toYamlStringShortHand
用の map の生成.inherited -
toMapShortHandA(
) → Map< String, dynamic> -
inherited
-
toString(
) → String -
toMap() に依存.
inherited
Operators
-
operator ==(
dynamic other) → bool -
instance properties の toString() をそれぞれ比較し合う。
toMap(), [] operator に依存.
inherited
-
operator [](
String key) → Object -
toMap() から、operator == の内容を自動更新できるようにするために定義している.
inherited
Static Methods
-
tryAndCatch<
RT extends Object, ET extends Exception> (RT tryAction()) → Result< RT, ET> -
RT...return type
ET...exception type
-
tryAndWrap<
RT extends Object, CT extends Exception, ET extends Exception> (RT tryAction(), ET customExceptionFactory(CT e)) → Result< RT, ET> -
RT...return type
CT...catch exception type
ET...custom exception type
-
tryAndWrapFuture<
RT extends Object, CT extends Exception, ET extends Exception> (Future< RT> tryAction(), ET customExceptionFactory(CT e)) → Future<Result< RT, ET> > -
RT...return type
CT...catch exception type
ET...custom exception type