public Map<String, Object> toMap() {
    ImmutableMap.Builder<String, Object> builder =
        ImmutableMap.<String, Object>builder()
            .put(DATA_TYPE_KEY, transferDataType().getDataType())
            .put(EXPORT_SERVICE_KEY, exportService())
            .put(IMPORT_SERVICE_KEY, importService())
            .put(AUTHORIZATION_STATE, jobAuthorization().state().toString())
            .put(JOB_STATE, state().toString());
    if (jobAuthorization().sessionSecretKey() != null) {
      builder.put(ENCRYPTED_SESSION_KEY, jobAuthorization().sessionSecretKey());
    }

    if (null != exportInformation()) {
      builder.put(EXPORT_INFORMATION_KEY, exportInformation());
    }

    if (null != jobAuthorization().authPublicKey()) {
      builder.put(WORKER_INSTANCE_PUBLIC_KEY, jobAuthorization().authPublicKey());
    }

    if (null != jobAuthorization().instanceId()) {
      builder.put(WORKER_INSTANCE_ID, jobAuthorization().instanceId());
    }

    if (null != jobAuthorization().encryptedAuthData()) {
      builder.put(ENCRYPTED_CREDS_KEY, jobAuthorization().encryptedAuthData());
    }

    if (null != failureReason()) {
      builder.put(FAILURE_REASON, failureReason());
    }

    builder.put(
        ENCRYPTION_SCHEME,
        null != jobAuthorization().encryptionScheme()
            ? jobAuthorization().encryptionScheme()
            : "jwe");

    if (null != jobAuthorization().encryptedInitialExportAuthData()) {
      builder.put(
          EXPORT_ENCRYPTED_INITIAL_AUTH_DATA, jobAuthorization().encryptedInitialExportAuthData());
    }

    if (null != jobAuthorization().encryptedInitialImportAuthData()) {
      builder.put(
          IMPORT_ENCRYPTED_INITIAL_AUTH_DATA, jobAuthorization().encryptedInitialImportAuthData());
    }

    if (null != userTimeZone()) {
      builder.put(USER_TIMEZONE, userTimeZone());
    }

    if (null != userLocale()) {
      builder.put(USER_LOCALE, userLocale());
    }

    if (null != userAlias()) {
      builder.put(USER_ALIAS, userAlias());
    }

    if (null != transferMode()) {
      builder.put(TRANSFER_MODE, transferMode().toString());
    }

    return builder.build();
  }
Checks all {@code strings} are have non-null and non-empty values.
portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/types/PortabilityJob.java