@@ -5,39 +5,29 @@ import '../../../api.dart' as api;
5
5
6
6
/// Representation of the context of an individual span.
7
7
class SpanContext {
8
- final api.SpanId _spanId;
9
- final api.TraceId _traceId;
10
- final int _traceFlags;
11
- final api.TraceState _traceState;
12
- final bool _isRemote;
13
-
14
- api.TraceId get traceId => _traceId;
15
-
16
- api.SpanId get spanId => _spanId;
17
-
18
- int get traceFlags => _traceFlags;
19
-
20
- api.TraceState get traceState => _traceState;
8
+ final api.TraceId traceId;
9
+ final api.SpanId spanId;
10
+ final int traceFlags;
11
+ final api.TraceState traceState;
12
+ final bool isRemote;
21
13
22
14
bool get isValid => spanId.isValid && traceId.isValid;
23
15
24
16
/// Construct a [SpanContext] .
25
- SpanContext (this ._traceId , this ._spanId , this ._traceFlags , this ._traceState )
26
- : _isRemote = false ;
17
+ SpanContext (this .traceId , this .spanId , this .traceFlags , this .traceState )
18
+ : isRemote = false ;
27
19
28
- /// Construct a [SpanContext] representing an operation which originated
29
- /// from a remote source.
20
+ /// Construct a [SpanContext] representing an operation which originated from
21
+ /// a remote source.
30
22
SpanContext .remote (
31
- this ._traceId , this ._spanId , this ._traceFlags , this ._traceState )
32
- : _isRemote = true ;
23
+ this .traceId , this .spanId , this .traceFlags , this .traceState )
24
+ : isRemote = true ;
33
25
34
26
/// Construct an invalid [SpanContext] .
35
27
SpanContext .invalid ()
36
- : _spanId = api.SpanId .invalid (),
37
- _traceId = api.TraceId .invalid (),
38
- _traceFlags = api.TraceFlags .none,
39
- _traceState = api.TraceState .empty (),
40
- _isRemote = false ;
41
-
42
- bool get isRemote => _isRemote;
28
+ : spanId = api.SpanId .invalid (),
29
+ traceId = api.TraceId .invalid (),
30
+ traceFlags = api.TraceFlags .none,
31
+ traceState = api.TraceState .empty (),
32
+ isRemote = false ;
43
33
}
0 commit comments