Consumer insertType()

in wayang-commons/wayang-core/src/main/java/org/apache/wayang/core/util/json/WayangJsonArray.java [78:100]


  Consumer<Object> insertType(Object value){
    ArrayNode node = this.getNode();
    if(value == null){
      return (v) ->  node.add(WayangJsonObj.NULL);
    }else if(value instanceof Integer){
      return (v) ->  node.add((Integer) v);
    }else if(value instanceof Long){
      return (v) ->  node.add((Long) v);
    }else if(value instanceof Float){
      return (v) ->  node.add((Float) v);
    }else if(value instanceof String){
      return (v) ->  node.add((String) v);
    }else if(value instanceof Double){
      return (v) ->  node.add((Double) v);
    }else if(value instanceof JsonNode){
      return (v) -> node.add((JsonNode) v);
    }else if(value instanceof WayangJsonArray){
      return (v) -> node.add(((WayangJsonArray)v).getNode());
    }else if(value instanceof WayangJsonObj){
      return (v) -> node.add(((WayangJsonObj)v).getNode());
    }
    throw new WayangException("The type is not recognizable "+ value.getClass());
  }