private BaseJsonNode toNode(Object value) {
		if (value != null) {
			if (value instanceof Tuple) {
				return toObjectNode((Tuple) value);
			}
			else if (value instanceof List<?>) {
				return toArrayNode((List<?>) value);
			}
			else if (!value.getClass().isPrimitive()) {
				return mapper.getNodeFactory().pojoNode(value);
			}
			else {
				return mapper.valueToTree(value);
			}
		}
		return null;
	}
Converts a Tuple to JSON representation

@author David Turanski
@author Gunnar Hillert
spring-xd-tuple/src/main/java/org/springframework/xd/tuple/TupleToJsonStringConverter.java