FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
zstack/utils/src/main/java/org/zstack/utils/YamlUtils.java at master · zstackio/zstack · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
zstackio
/
zstack
Public
Notifications
You must be signed in to change notification settings
Fork
399
Star
1.4k
Code
Issues
163
Pull requests
13
Actions
Projects
Wiki
Security and quality
4
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
zstack
/
utils
/
src
/
main
/
java
/
org
/
zstack
/
utils
/
YamlUtils.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (20 loc) · 612 Bytes
Breadcrumbs
zstack
/
utils
/
src
/
main
/
java
/
org
/
zstack
/
utils
/
YamlUtils.java
Copy path
File metadata and controls
23 lines (20 loc) · 612 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package
org
.
zstack
.
utils
;
import
org
.
yaml
.
snakeyaml
.
DumperOptions
;
import
org
.
yaml
.
snakeyaml
.
Yaml
;
/**
* @Author: qiuyu.zhang
* @Date: 2024/4/8 14:17
*/
public
class
YamlUtils
{
public
static
String
dump
(
Object
obj
) {
DumperOptions
options
=
new
DumperOptions
();
options
.
setDefaultFlowStyle
(
DumperOptions
.
FlowStyle
.
BLOCK
);
options
.
setDefaultScalarStyle
(
DumperOptions
.
ScalarStyle
.
PLAIN
);
Yaml
yaml
=
new
Yaml
(
options
);
return
yaml
.
dump
(
obj
);
}
public
static
Object
load
(
String
str
) {
Yaml
yaml
=
new
Yaml
();
return
yaml
.
load
(
str
);
}
}
Back
|
FazBrowse Home
|
New Git URL