新增操作

@param obj
@return String
975501
public String insert(Object obj) {
    PersistMeta meta = EntityUtil.getMeta(obj.getClass());
    StringBuilder names = new StringBuilder(), values = new StringBuilder();
    int i = 0;
    for (Map.Entry<String, Field> kv : meta.getColumns().entrySet()) {
      if (isNull(kv.getValue(), obj)) {
        continue;
      }

      if (i++ != 0) {
        names.append(',');
        values.append(',');
      }

      names.append('`').append(kv.getKey()).append('`');
      values.append("#{").append(kv.getValue().getName()).append('}');
    }

    return new SQL().INSERT_INTO(getTableName(meta, obj)).VALUES(names.toString(), values.toString()).toString();
  }
355916
function stringify (obj) {
  var s = [];
  Object.keys(obj).forEach(function (key) {
    s.push(key);
    s.push('=\'');
    s.push(obj[key]);
    s.push('\';');
  });
  return s.join('');
}
511387
public static String unpackString(Object obj) {
        Object value = unpack(obj);
        return value == null ? null : value.toString();
    }
736446
def update(self, obj_id, is_public=NotUpdated, is_protected=NotUpdated):
        """"""

        data = {}
        self._copy_if_updated(data, is_public=is_public,
                              is_protected=is_protected)
        return self._patch('/job-executions/%s' % obj_id, data)
57649
function(str, obj) {
    var replacer = function(wholeMatch, key) {
      return obj[key] === undefined ? wholeMatch : obj[key];
    },
    regexp = new RegExp('{{\\s*([a-z0-9-_]+)\\s*}}',"ig");

    for(var beforeReplace = ""; beforeReplace !== str; str = (beforeReplace = str).replace(regexp, replacer)){

    }
    return str;
  }
43961
function fixer(obj) {
  var result = []
  Object.keys(obj).forEach(AttributeName=> {
    result.push({
      AttributeName,
      AttributeType: obj[AttributeName].replace('**', '').replace('*', '').replace('Number', 'N').replace('String', 'S')
    })
  })
  return result
}
642956
public static String getJSON(Object obj, ObjectInspector objIns) {
        StringBuilder sb = new StringBuilder();
        buildJSONString(sb, obj, objIns);
        return sb.toString();
    }
487370
public static String toXml(final Object obj) {
		final ByteArrayOutputStream out = new ByteArrayOutputStream();

		// XStream x = createXStream();
		// String xml = x.toXML(obj);
		// return xml;
		final XMLEncoder e = new XMLEncoder(out);
		e.setExceptionListener(new JKObjectUtil.XmlEncoderExceptionListener());
		// e.setPersistenceDelegate(Object.class, new MyPersistenceDelegate());
		e.writeObject(obj);
		e.close();
		return out.toString();
		// return null;
	}
401608
function format(obj)
{
  var output;

  if (typeOf(obj) == 'object' || typeOf(obj) == 'array' || typeOf(obj) == 'null')
  {
    output = JSON.stringify(obj);
  }
  else if (typeOf(obj) != 'undefined')
  {
    output = obj.toString();
  }
  else
  {
    output = '';
  }

  return output;
}
737830
function makeDocString(obj) {
        var docStr = obj
        if (Array.isArray(docStr)) {
            docStr = docStr.join('\n');
        }
        return docStr;
    }
826658
public static Update updatePojo(Object pojo) {
      Objects.requireNonNull(pojo, "Pojo cannot be null");

      ObjectNode set = JsonNodeFactory.instance.objectNode();
      JsonNode pojoAsJson = JSON.toJsonNode(pojo);
      if (!(pojoAsJson instanceof ObjectNode)) {
        throw new IllegalArgumentException(pojo+" is not a pojo!");
      }
      set.set("$set", pojoAsJson);
      return new Update(set);
    }
325358
function updateKeys(obj, _) {
    var newObj = null;
    if (_.isArray(obj)) {
        newObj = [];
    } else if (_.isObject(obj)) {
        newObj = {};
    } else {
        return obj;
    }
    _.forEach(obj, function(value, key) {
        if (key.replace) {
            var newKey = key.replace(/\$|\./g, '_');
            newObj[newKey] = updateKeys(value, _);
        } else {
            newObj[key] = updateKeys(value, _);
        }
    });
    return newObj;
}
1228134
@Override
    public void update(Number obj) {
        if (enable == false) {
            return;
        }

        if (intervalCheck.check()) {
            flush();
        }
        synchronized (this) {
            unflushed = updater.update(obj, unflushed);
        }
    }
360832
function serialize(obj) {
  var params = [],
    encodedBrackets = encodeURIComponent('[]');

  _.forOwn(obj, function(value, key) {
    if (typeof value === 'string' ||
      typeof value === 'number' ||
      typeof value === 'boolean') {
      params.push(key + '=' + encodeURIComponent(value));
    } else if (typeof value === 'object' && Array.isArray(value)) {
      params.push(value.map(function(param) {
        return key + encodedBrackets + '=' + encodeURIComponent(param);
      }).join('&'));
    }
  });

  return params.join('&');
}
506536
public static JSON parse(Object obj) {
		if (null == obj) {
			return null;
		}

		JSON json = null;
		if (obj instanceof JSON) {
			json = (JSON) obj;
		} else if (obj instanceof String) {
			String jsonStr = ((String) obj).trim();
			if (jsonStr.startsWith("[")) {
				json = parseArray(jsonStr);
			} else {
				json = parseObj(jsonStr);
			}
		} else if (obj instanceof Collection || obj.getClass().isArray()) {// 列表
			json = new JSONArray(obj);
		} else {// 对象
			json = new JSONObject(obj);
		}

		return json;
	}
255742
private static function objectToString($obj)
    {
        return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_hash($obj);
    }
586918
function (obj) {
            if (typeof obj === "undefined")
                /*  get current object  */
                return this.__obj;
            else if (typeof obj === "object") {
                /*  set new object  */
                if (obj !== null) {
                    _cs.annotation(obj, "comp", this);
                    this.__obj = obj;
                }
                else {
                    if (this.__obj !== null)
                        _cs.annotation(this.__obj, "comp", null);
                    this.__obj = null;
                }
            }
            else
                throw _cs.exception("obj", "invalid argument");
            return this;
        }