Skip to content

Commit

Permalink
Add json conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Hafner committed Apr 25, 2024
1 parent 1a4f8af commit 12aa4e8
Showing 1 changed file with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.polypheny.db.adapter.json;

import com.fasterxml.jackson.databind.JsonNode;
import java.io.IOException;
import java.util.HashMap;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
Expand Down Expand Up @@ -52,12 +51,24 @@ public PolyMap<PolyString, PolyValue> nodeToPolyMap( JsonNode node ) {

public PolyValue nodeToPolyValue( JsonNode node ) {
switch ( node.getNodeType() ) {
case NULL -> {return nodeToPolyNull();}
case ARRAY -> {return nodeToPolyList( node );}
case OBJECT -> {return nodeToPolyMap( node );}
case NUMBER -> {return nodeToPolyNumber( node );}
case STRING -> {return nodeToPolyString( node );}
case BOOLEAN -> {return nodeToPolyBoolean( node );}
case NULL -> {
return nodeToPolyNull();
}
case ARRAY -> {
return nodeToPolyList( node );
}
case OBJECT -> {
return nodeToPolyMap( node );
}
case NUMBER -> {
return nodeToPolyNumber( node );
}
case STRING -> {
return nodeToPolyString( node );
}
case BOOLEAN -> {
return nodeToPolyBoolean( node );
}
}
return new PolyNull();
}
Expand Down

0 comments on commit 12aa4e8

Please sign in to comment.