}
public JSONObject toJson(Item item) {
JSONObject result = new JSONObject();
result.put(KEY, new JSONString(toNullableValue(item.getKey())));
result.put(ID, new JSONNumber(item.getId()));
result.put(TEXT, new JSONString(item.getText()));
result.put(PRIORITY, new JSONString(item.getPriority().toString()));
result.put(STATUS, new JSONString(item.getStatus().toString()));
result.put(CREATED, new JSONNumber(item.getCreated().getTime()));
result.put(UPDATED, new JSONNumber(item.getUpdated().getTime()));
return result;
}