refactor: Move lib/types into lib/xmpp
This commit is contained in:
parent
7d5b389f35
commit
cc52fa9128
@ -1,9 +0,0 @@
|
|||||||
class Result<S, V> {
|
|
||||||
final S _state;
|
|
||||||
final V _value;
|
|
||||||
|
|
||||||
Result(S state, V value) : _state = state, _value = value;
|
|
||||||
|
|
||||||
S getState() => _state;
|
|
||||||
V getValue() => _value;
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
import "package:moxxyv2/xmpp/stringxml.dart";
|
import "package:moxxyv2/xmpp/stringxml.dart";
|
||||||
import "package:moxxyv2/types/result.dart";
|
import "package:moxxyv2/xmpp/types/result.dart";
|
||||||
|
|
||||||
enum AuthenticationResult {
|
enum AuthenticationResult {
|
||||||
success,
|
success,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import "dart:convert";
|
import "dart:convert";
|
||||||
|
|
||||||
import "package:moxxyv2/types/result.dart";
|
import "package:moxxyv2/xmpp/types/result.dart";
|
||||||
import "package:moxxyv2/xmpp/stringxml.dart";
|
import "package:moxxyv2/xmpp/stringxml.dart";
|
||||||
import "package:moxxyv2/xmpp/sasl/authenticator.dart";
|
import "package:moxxyv2/xmpp/sasl/authenticator.dart";
|
||||||
import "package:moxxyv2/xmpp/sasl/errors.dart";
|
import "package:moxxyv2/xmpp/sasl/errors.dart";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import "dart:convert";
|
import "dart:convert";
|
||||||
import "dart:math" show Random;
|
import "dart:math" show Random;
|
||||||
|
|
||||||
import "package:moxxyv2/types/result.dart";
|
import "package:moxxyv2/xmpp/types/result.dart";
|
||||||
import "package:moxxyv2/xmpp/stringxml.dart";
|
import "package:moxxyv2/xmpp/stringxml.dart";
|
||||||
import "package:moxxyv2/xmpp/sasl/authenticator.dart";
|
import "package:moxxyv2/xmpp/sasl/authenticator.dart";
|
||||||
import "package:moxxyv2/xmpp/sasl/errors.dart";
|
import "package:moxxyv2/xmpp/sasl/errors.dart";
|
||||||
|
13
lib/xmpp/types/result.dart
Normal file
13
lib/xmpp/types/result.dart
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/// Class that is supposed to by used with a state type S and a value type V.
|
||||||
|
/// The state indicates if an action was successful or not, while the value
|
||||||
|
/// type indicates the return value, i.e. a result in a computation or the
|
||||||
|
/// actual error description.
|
||||||
|
class Result<S, V> {
|
||||||
|
final S _state;
|
||||||
|
final V _value;
|
||||||
|
|
||||||
|
Result(S state, V value) : _state = state, _value = value;
|
||||||
|
|
||||||
|
S getState() => _state;
|
||||||
|
V getValue() => _value;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user