private LayoutDatabase jsonObjectToLayoutDatabase(JSONObject json) {
    LayoutDatabase layoutDatabase = new LayoutDatabase();

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_ID_KEY)) {
      layoutDatabase.setId(
          getIntFromJSONObject(json, ApplicationContentDownloaderAsyncTask.LAYOUT_ID_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_PARENT_ID_KEY)) {
      layoutDatabase.setParentId(
          getIntFromJSONObject(json, ApplicationContentDownloaderAsyncTask.LAYOUT_PARENT_ID_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_INDEX_KEY)) {
      layoutDatabase.setIndex(
          getIntFromJSONObject(json, ApplicationContentDownloaderAsyncTask.LAYOUT_INDEX_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_TITLE_EN_KEY)) {
      layoutDatabase.setTitleEn(
          getStringFromJSONObject(json, ApplicationContentDownloaderAsyncTask.LAYOUT_TITLE_EN_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_TITLE_PL_KEY)) {
      layoutDatabase.setTitlePl(
          getStringFromJSONObject(json, ApplicationContentDownloaderAsyncTask.LAYOUT_TITLE_PL_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_VERSION_KEY)) {
      layoutDatabase.setVersion(
          getIntFromJSONObject(json, ApplicationContentDownloaderAsyncTask.LAYOUT_VERSION_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_TYPE_KEY)) {
      layoutDatabase.setType(
          getStringFromJSONObject(json, ApplicationContentDownloaderAsyncTask.LAYOUT_TYPE_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_CONTENT_EN_KEY)) {
      layoutDatabase.setContentEn(
          getStringFromJSONObject(
              json, ApplicationContentDownloaderAsyncTask.LAYOUT_CONTENT_EN_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_FAQ_EN_KEY)) {
      layoutDatabase.setContentEn(
          getStringFromJSONObject(json, ApplicationContentDownloaderAsyncTask.LAYOUT_FAQ_EN_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_CONTENT_PL_KEY)) {
      layoutDatabase.setContentPl(
          getStringFromJSONObject(
              json, ApplicationContentDownloaderAsyncTask.LAYOUT_CONTENT_PL_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_FAQ_PL_KEY)) {
      layoutDatabase.setContentPl(
          getStringFromJSONObject(json, ApplicationContentDownloaderAsyncTask.LAYOUT_FAQ_PL_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_ADDITIONAL_EN_KEY)) {
      layoutDatabase.setAdditionalEn(
          getStringFromJSONObject(
              json, ApplicationContentDownloaderAsyncTask.LAYOUT_ADDITIONAL_EN_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_ADDITIONAL_PL_KEY)) {
      layoutDatabase.setAdditionalPl(
          getStringFromJSONObject(
              json, ApplicationContentDownloaderAsyncTask.LAYOUT_ADDITIONAL_PL_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_LATITUDE_KEY)) {
      layoutDatabase.setLatitude(
          (float)
              getDoubleFromJSONObject(
                  json, ApplicationContentDownloaderAsyncTask.LAYOUT_LATITUDE_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_LONGITUDE_KEY)) {
      layoutDatabase.setLongitude(
          (float)
              getDoubleFromJSONObject(
                  json, ApplicationContentDownloaderAsyncTask.LAYOUT_LONGITUDE_KEY));
    }

    if (json.has(ApplicationContentDownloaderAsyncTask.LAYOUT_ZOOM_KEY)) {
      layoutDatabase.setZoom(
          getIntFromJSONObject(json, ApplicationContentDownloaderAsyncTask.LAYOUT_ZOOM_KEY));
    }

    return layoutDatabase;
  }