private void encodePayload(Cursor current, Object payload) {
        if (payload instanceof String) {
            current.setString(PAYLOAD, (String)payload);
        } else if (payload instanceof Long) {
            current.setLong(PAYLOAD, (Long) payload);
        } else if (payload instanceof Boolean) {
            current.setBool(PAYLOAD, (Boolean) payload);
        } else if (payload instanceof Double) {
            current.setDouble(PAYLOAD, (Double) payload);
        } else if (payload instanceof byte[]) {
            current.setData(PAYLOAD, (byte[]) payload);
        }
    }
Serialize a {@link TraceNode} to {@link com.yahoo.slime.Slime}.

@author Ulf Lilleengen
config/src/main/java/com/yahoo/vespa/config/protocol/SlimeTraceSerializer.java