File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
main/java/com/github/underscore
test/java/com/github/underscore Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ public XmlBuilder remove(final String key) {
123123 return this ;
124124 }
125125
126+ public Map <String , Object > build () {
127+ return U .deepCopyMap (data );
128+ }
129+
126130 public XmlBuilder clear () {
127131 data .clear ();
128132 return this ;
Original file line number Diff line number Diff line change @@ -132,6 +132,12 @@ void remove() {
132132 "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n <root></root>" , xmlBuilder .asString ());
133133 }
134134
135+ @ Test
136+ void build () {
137+ XmlBuilder xmlBuilder = new XmlBuilder ("xml" ).e ("123" );
138+ assertEquals ("{xml={123={-self-closing=true}}}" , xmlBuilder .build ().toString ());
139+ }
140+
135141 @ Test
136142 void clear () {
137143 XmlBuilder xmlBuilder = new XmlBuilder ("xml" ).e ("123" );
You can’t perform that action at this time.
0 commit comments