Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CAP
Commits
f67a8682
Commit
f67a8682
authored
Apr 10, 2019
by
彭伟
Committed by
Lemon
Apr 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add implicit convert (#187)
* Add general host * Add sign * Add implicit convert
parent
10b7aaba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
StringOrIntValue.cs
src/SkyApm.Abstractions/Common/StringOrIntValue.cs
+8
-5
No files found.
src/SkyApm.Abstractions/Common/StringOrIntValue.cs
View file @
f67a8682
/*
/*
* Licensed to the SkyAPM under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
...
...
@@ -32,7 +32,7 @@ namespace SkyApm.Common
public
bool
HasValue
=>
HasIntValue
||
HasStringValue
;
public
bool
HasIntValue
=>
_intValue
!=
0
;
public
bool
HasStringValue
=>
_stringValue
!=
null
;
public
StringOrIntValue
(
string
value
)
...
...
@@ -48,9 +48,9 @@ namespace SkyApm.Common
}
public
int
GetIntValue
()
=>
_intValue
;
public
string
GetStringValue
()
=>
_stringValue
;
public
(
string
,
int
)
GetValue
()
{
return
(
_stringValue
,
_intValue
);
...
...
@@ -61,5 +61,8 @@ namespace SkyApm.Common
if
(
HasIntValue
)
return
_intValue
.
ToString
();
return
_stringValue
;
}
public
static
implicit
operator
StringOrIntValue
(
string
value
)
=>
new
StringOrIntValue
(
value
);
public
static
implicit
operator
StringOrIntValue
(
int
value
)
=>
new
StringOrIntValue
(
value
);
}
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment