/**
   * convert AccountCodeObjectKeyFilter to a Map (not including the root).
   *
   * @param in the filter to convert to the Map
   * @param record use this Map instead of creating a new one (Optional)
   * @return Map the output Map
   */
  protected static Map getMap(AccountCodeObjectKeyFilter in, Map record) {
    Object[] list = null;
    Map map = null;
    if (record == null) record = new HashMap();
    if (in == null) return record;
    if (in._fetch) record.put("Fetch", Boolean.TRUE);

    map =
        DataHelper.filterToMap(
            in.AcgTrackingId,
            in.AcgTrackingIdSort,
            in.AcgTrackingIdSortAscending,
            in.AcgTrackingIdFetch);
    if (map != null) record.put("AcgTrackingId", map);
    map =
        DataHelper.filterToMap(
            in.AcgTrackingIdServ,
            in.AcgTrackingIdServSort,
            in.AcgTrackingIdServSortAscending,
            in.AcgTrackingIdServFetch);
    if (map != null) record.put("AcgTrackingIdServ", map);
    map =
        DataHelper.filterToMap(
            in.AccountCode,
            in.AccountCodeSort,
            in.AccountCodeSortAscending,
            in.AccountCodeFetch,
            in.AccountCodeCaseInsensitive);
    if (map != null) record.put("AccountCode", map);
    return record;
  }
  /**
   * convert AccountHqContractObjectKeyFilter to a Map (not including the root).
   *
   * @param in the filter to convert to the Map
   * @param record use this Map instead of creating a new one (Optional)
   * @return Map the output Map
   */
  protected static Map getMap(AccountHqContractObjectKeyFilter in, Map record) {
    Object[] list = null;
    Map map = null;
    if (record == null) record = new HashMap();
    if (in == null) return record;
    if (in._fetch) record.put("Fetch", Boolean.TRUE);

    map =
        DataHelper.filterToMap(
            in.AccountInternalId,
            in.AccountInternalIdSort,
            in.AccountInternalIdSortAscending,
            in.AccountInternalIdFetch);
    if (map != null) record.put("AccountInternalId", map);
    map =
        DataHelper.filterToMap(
            in.TrackingId, in.TrackingIdSort, in.TrackingIdSortAscending, in.TrackingIdFetch);
    if (map != null) record.put("TrackingId", map);
    map =
        DataHelper.filterToMap(
            in.TrackingIdServ,
            in.TrackingIdServSort,
            in.TrackingIdServSortAscending,
            in.TrackingIdServFetch);
    if (map != null) record.put("TrackingIdServ", map);
    map =
        DataHelper.filterToMap(
            in.StartDt, in.StartDtSort, in.StartDtSortAscending, in.StartDtFetch);
    if (map != null) record.put("StartDt", map);
    return record;
  }
  /**
   * convert PrivacyLevelObjectKeyFilter to a Map (not including the root).
   *
   * @param in the filter to convert to the Map
   * @param record use this Map instead of creating a new one (Optional)
   * @return Map the output Map
   */
  protected static Map getMap(PrivacyLevelObjectKeyFilter in, Map record) {
    Object[] list = null;
    Map map = null;
    if (record == null) record = new HashMap();
    if (in == null) return record;
    if (in._fetch) record.put("Fetch", Boolean.TRUE);

    map = DataHelper.filterToMap(in.Level, in.LevelSort, in.LevelSortAscending, in.LevelFetch);
    if (map != null) record.put("Level", map);
    map =
        DataHelper.filterToMap(
            in.LanguageCode,
            in.LanguageCodeSort,
            in.LanguageCodeSortAscending,
            in.LanguageCodeFetch);
    if (map != null) record.put("LanguageCode", map);
    return record;
  }
  /**
   * convert ContactObjectFilter to a Map (not including the root).
   *
   * @param in the filter to convert to the Map
   * @param record use this Map instead of creating a new one (Optional)
   * @return Map the output Map
   */
  public static Map getMap(ContactObjectFilter in, Map record) {
    Object[] list = null;
    Map map = null;
    if (record == null) record = new HashMap();
    if (in == null) return record;
    if (in._fetch) record.put("Fetch", Boolean.TRUE);

    if (in.Key != null)
      record.put("Key", ContactObjectKeyHelper.getMap(in.Key, (Map) record.get("Key")));
    map =
        DataHelper.filterToMap(
            in.CreateDt, in.CreateDtSort, in.CreateDtSortAscending, in.CreateDtFetch);
    if (map != null) record.put("CreateDt", map);
    map = DataHelper.filterToMap(in.ChgDt, in.ChgDtSort, in.ChgDtSortAscending, in.ChgDtFetch);
    if (map != null) record.put("ChgDt", map);
    map =
        DataHelper.filterToMap(
            in.ChgWho,
            in.ChgWhoSort,
            in.ChgWhoSortAscending,
            in.ChgWhoFetch,
            in.ChgWhoCaseInsensitive);
    if (map != null) record.put("ChgWho", map);
    map =
        DataHelper.filterToMap(
            in.NamePrefix,
            in.NamePrefixSort,
            in.NamePrefixSortAscending,
            in.NamePrefixFetch,
            in.NamePrefixCaseInsensitive);
    if (map != null) record.put("NamePrefix", map);
    map =
        DataHelper.filterToMap(
            in.FirstName,
            in.FirstNameSort,
            in.FirstNameSortAscending,
            in.FirstNameFetch,
            in.FirstNameCaseInsensitive);
    if (map != null) record.put("FirstName", map);
    map =
        DataHelper.filterToMap(
            in.MiddleName,
            in.MiddleNameSort,
            in.MiddleNameSortAscending,
            in.MiddleNameFetch,
            in.MiddleNameCaseInsensitive);
    if (map != null) record.put("MiddleName", map);
    map =
        DataHelper.filterToMap(
            in.LastName,
            in.LastNameSort,
            in.LastNameSortAscending,
            in.LastNameFetch,
            in.LastNameCaseInsensitive);
    if (map != null) record.put("LastName", map);
    map =
        DataHelper.filterToMap(
            in.Generation,
            in.GenerationSort,
            in.GenerationSortAscending,
            in.GenerationFetch,
            in.GenerationCaseInsensitive);
    if (map != null) record.put("Generation", map);
    map =
        DataHelper.filterToMap(
            in.Title, in.TitleSort, in.TitleSortAscending, in.TitleFetch, in.TitleCaseInsensitive);
    if (map != null) record.put("Title", map);
    map =
        DataHelper.filterToMap(
            in.Company,
            in.CompanySort,
            in.CompanySortAscending,
            in.CompanyFetch,
            in.CompanyCaseInsensitive);
    if (map != null) record.put("Company", map);
    map =
        DataHelper.filterToMap(
            in.AddressId, in.AddressIdSort, in.AddressIdSortAscending, in.AddressIdFetch);
    if (map != null) record.put("AddressId", map);
    map =
        DataHelper.filterToMap(
            in.AltLname,
            in.AltLnameSort,
            in.AltLnameSortAscending,
            in.AltLnameFetch,
            in.AltLnameCaseInsensitive);
    if (map != null) record.put("AltLname", map);
    map =
        DataHelper.filterToMap(
            in.AltFname,
            in.AltFnameSort,
            in.AltFnameSortAscending,
            in.AltFnameFetch,
            in.AltFnameCaseInsensitive);
    if (map != null) record.put("AltFname", map);
    map =
        DataHelper.filterToMap(
            in.AltCompany,
            in.AltCompanySort,
            in.AltCompanySortAscending,
            in.AltCompanyFetch,
            in.AltCompanyCaseInsensitive);
    if (map != null) record.put("AltCompany", map);
    map = DataHelper.filterToMap(in.Gender, in.GenderSort, in.GenderSortAscending, in.GenderFetch);
    if (map != null) record.put("Gender", map);
    map =
        DataHelper.filterToMap(
            in.Dept, in.DeptSort, in.DeptSortAscending, in.DeptFetch, in.DeptCaseInsensitive);
    if (map != null) record.put("Dept", map);
    map =
        DataHelper.filterToMap(
            in.DateActive, in.DateActiveSort, in.DateActiveSortAscending, in.DateActiveFetch);
    if (map != null) record.put("DateActive", map);
    map =
        DataHelper.filterToMap(
            in.DateInactive,
            in.DateInactiveSort,
            in.DateInactiveSortAscending,
            in.DateInactiveFetch);
    if (map != null) record.put("DateInactive", map);
    map =
        DataHelper.filterToMap(
            in.AddressLine1,
            in.AddressLine1Sort,
            in.AddressLine1SortAscending,
            in.AddressLine1Fetch,
            in.AddressLine1CaseInsensitive);
    if (map != null) record.put("AddressLine1", map);
    map =
        DataHelper.filterToMap(
            in.AddressLine2,
            in.AddressLine2Sort,
            in.AddressLine2SortAscending,
            in.AddressLine2Fetch,
            in.AddressLine2CaseInsensitive);
    if (map != null) record.put("AddressLine2", map);
    map =
        DataHelper.filterToMap(
            in.AddressLine3,
            in.AddressLine3Sort,
            in.AddressLine3SortAscending,
            in.AddressLine3Fetch,
            in.AddressLine3CaseInsensitive);
    if (map != null) record.put("AddressLine3", map);
    map =
        DataHelper.filterToMap(
            in.AddressLine4,
            in.AddressLine4Sort,
            in.AddressLine4SortAscending,
            in.AddressLine4Fetch,
            in.AddressLine4CaseInsensitive);
    if (map != null) record.put("AddressLine4", map);
    map =
        DataHelper.filterToMap(
            in.City, in.CitySort, in.CitySortAscending, in.CityFetch, in.CityCaseInsensitive);
    if (map != null) record.put("City", map);
    map =
        DataHelper.filterToMap(
            in.State, in.StateSort, in.StateSortAscending, in.StateFetch, in.StateCaseInsensitive);
    if (map != null) record.put("State", map);
    map =
        DataHelper.filterToMap(
            in.PostalCode,
            in.PostalCodeSort,
            in.PostalCodeSortAscending,
            in.PostalCodeFetch,
            in.PostalCodeCaseInsensitive);
    if (map != null) record.put("PostalCode", map);
    map =
        DataHelper.filterToMap(
            in.CountryCode, in.CountryCodeSort, in.CountryCodeSortAscending, in.CountryCodeFetch);
    if (map != null) record.put("CountryCode", map);
    map =
        DataHelper.filterToMap(
            in.FranchiseTaxCode,
            in.FranchiseTaxCodeSort,
            in.FranchiseTaxCodeSortAscending,
            in.FranchiseTaxCodeFetch);
    if (map != null) record.put("FranchiseTaxCode", map);
    map =
        DataHelper.filterToMap(
            in.Geocode,
            in.GeocodeSort,
            in.GeocodeSortAscending,
            in.GeocodeFetch,
            in.GeocodeCaseInsensitive);
    if (map != null) record.put("Geocode", map);
    map =
        DataHelper.filterToMap(
            in.County,
            in.CountySort,
            in.CountySortAscending,
            in.CountyFetch,
            in.CountyCaseInsensitive);
    if (map != null) record.put("County", map);
    return record;
  }