File tree Expand file tree Collapse file tree
api/src/main/java/com/apicatalog/tree/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .apicatalog .tree .io ;
22
33import java .util .Collection ;
4+ import java .util .Map ;
45import java .util .Map .Entry ;
56import java .util .Objects ;
67import java .util .Set ;
78import java .util .function .Consumer ;
89import java .util .stream .Stream ;
910
11+ import com .apicatalog .tree .io .java .JavaTree ;
12+
1013/**
1114 * Immutable representation of a tree node where the node and its descendants
1215 * are accessed through a {@link TreeAdapter}.
@@ -39,6 +42,14 @@ public record Tree(
3942 adapter = Objects .requireNonNull (adapter );
4043 }
4144
45+ public static Tree of (Map <?, ?> map ) {
46+ return JavaTree .of (map );
47+ }
48+
49+ public static Tree of (Collection <?> collection ) {
50+ return JavaTree .of (collection );
51+ }
52+
4253 public Features features () {
4354 return adapter .features ();
4455 }
You can’t perform that action at this time.
0 commit comments