/**
   * 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;
  }
  /**
   * convert ContactObjectData to a Map (not including the root).
   *
   * @param in the object 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(ContactObjectData in, Map record) {
    Object[] list = null;
    if (record == null) record = new HashMap();
    if (in == null) return record;

    if (in.Key != null)
      record.put("Key", ContactObjectKeyHelper.getMap(in.Key, (Map) record.get("Key")));
    if (in._CreateDtSet) record.put("CreateDt", in.CreateDt);

    if (in._ChgDtSet) record.put("ChgDt", in.ChgDt);

    if (in._ChgWhoSet) record.put("ChgWho", in.ChgWho);

    if (in._NamePrefixSet) record.put("NamePrefix", in.NamePrefix);

    if (in._FirstNameSet) record.put("FirstName", in.FirstName);

    if (in._MiddleNameSet) record.put("MiddleName", in.MiddleName);

    if (in._LastNameSet) record.put("LastName", in.LastName);

    if (in._GenerationSet) record.put("Generation", in.Generation);

    if (in._TitleSet) record.put("Title", in.Title);

    if (in._CompanySet) record.put("Company", in.Company);

    if (in._AddressIdSet) record.put("AddressId", in.AddressId);

    if (in._AltLnameSet) record.put("AltLname", in.AltLname);

    if (in._AltFnameSet) record.put("AltFname", in.AltFname);

    if (in._AltCompanySet) record.put("AltCompany", in.AltCompany);

    if (in._GenderSet) record.put("Gender", in.Gender);

    if (in._DeptSet) record.put("Dept", in.Dept);

    if (in._DateActiveSet) record.put("DateActive", in.DateActive);

    if (in._DateInactiveSet) record.put("DateInactive", in.DateInactive);

    if (in._AddressLine1Set) record.put("AddressLine1", in.AddressLine1);

    if (in._AddressLine2Set) record.put("AddressLine2", in.AddressLine2);

    if (in._AddressLine3Set) record.put("AddressLine3", in.AddressLine3);

    if (in._AddressLine4Set) record.put("AddressLine4", in.AddressLine4);

    if (in._CitySet) record.put("City", in.City);

    if (in._StateSet) record.put("State", in.State);

    if (in._PostalCodeSet) record.put("PostalCode", in.PostalCode);

    if (in._CountryCodeSet) record.put("CountryCode", in.CountryCode);

    if (in._FranchiseTaxCodeSet) record.put("FranchiseTaxCode", in.FranchiseTaxCode);

    if (in._GeocodeSet) record.put("Geocode", in.Geocode);

    if (in._CountySet) record.put("County", in.County);
    return record;
  }