Example #1
0
    public override string ToString()
    {
        StringBuilder __sb    = new StringBuilder("SearchItemUnion(");
        bool          __first = true;

        if (CategoryItem != null && __isset.categoryItem)
        {
            if (!__first)
            {
                __sb.Append(", ");
            }
            __first = false;
            __sb.Append("CategoryItem: ");
            __sb.Append(CategoryItem == null ? "<null>" : CategoryItem.ToString());
        }
        if (SpotItem != null && __isset.spotItem)
        {
            if (!__first)
            {
                __sb.Append(", ");
            }
            __first = false;
            __sb.Append("SpotItem: ");
            __sb.Append(SpotItem);
        }
        if (ProductItem != null && __isset.productItem)
        {
            if (!__first)
            {
                __sb.Append(", ");
            }
            __first = false;
            __sb.Append("ProductItem: ");
            __sb.Append(ProductItem == null ? "<null>" : ProductItem.ToString());
        }
        if (ServiceItem != null && __isset.serviceItem)
        {
            if (!__first)
            {
                __sb.Append(", ");
            }
            __first = false;
            __sb.Append("ServiceItem: ");
            __sb.Append(ServiceItem == null ? "<null>" : ServiceItem.ToString());
        }
        if (YellowpageItem != null && __isset.yellowpageItem)
        {
            if (!__first)
            {
                __sb.Append(", ");
            }
            __first = false;
            __sb.Append("YellowpageItem: ");
            __sb.Append(YellowpageItem == null ? "<null>" : YellowpageItem.ToString());
        }
        if (OaItem != null && __isset.oaItem)
        {
            if (!__first)
            {
                __sb.Append(", ");
            }
            __first = false;
            __sb.Append("OaItem: ");
            __sb.Append(OaItem == null ? "<null>" : OaItem.ToString());
        }
        if (GeoAddressItem != null && __isset.geoAddressItem)
        {
            if (!__first)
            {
                __sb.Append(", ");
            }
            __first = false;
            __sb.Append("GeoAddressItem: ");
            __sb.Append(GeoAddressItem == null ? "<null>" : GeoAddressItem.ToString());
        }
        if (ShortcutItem != null && __isset.shortcutItem)
        {
            if (!__first)
            {
                __sb.Append(", ");
            }
            __first = false;
            __sb.Append("ShortcutItem: ");
            __sb.Append(ShortcutItem == null ? "<null>" : ShortcutItem.ToString());
        }
        if (SquareItem != null && __isset.squareItem)
        {
            if (!__first)
            {
                __sb.Append(", ");
            }
            __first = false;
            __sb.Append("SquareItem: ");
            __sb.Append(SquareItem);
        }
        if (SquareCategoryItem != null && __isset.squareCategoryItem)
        {
            if (!__first)
            {
                __sb.Append(", ");
            }
            __first = false;
            __sb.Append("SquareCategoryItem: ");
            __sb.Append(SquareCategoryItem == null ? "<null>" : SquareCategoryItem.ToString());
        }
        __sb.Append(")");
        return(__sb.ToString());
    }
Example #2
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("SearchItemUnion");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (CategoryItem != null && __isset.categoryItem)
         {
             field.Name = "categoryItem";
             field.Type = TType.Struct;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             CategoryItem.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (SpotItem != null && __isset.spotItem)
         {
             field.Name = "spotItem";
             field.Type = TType.Struct;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             SpotItem.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (ProductItem != null && __isset.productItem)
         {
             field.Name = "productItem";
             field.Type = TType.Struct;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             ProductItem.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (ServiceItem != null && __isset.serviceItem)
         {
             field.Name = "serviceItem";
             field.Type = TType.Struct;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             ServiceItem.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (YellowpageItem != null && __isset.yellowpageItem)
         {
             field.Name = "yellowpageItem";
             field.Type = TType.Struct;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             YellowpageItem.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (OaItem != null && __isset.oaItem)
         {
             field.Name = "oaItem";
             field.Type = TType.Struct;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             OaItem.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (GeoAddressItem != null && __isset.geoAddressItem)
         {
             field.Name = "geoAddressItem";
             field.Type = TType.Struct;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             GeoAddressItem.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (ShortcutItem != null && __isset.shortcutItem)
         {
             field.Name = "shortcutItem";
             field.Type = TType.Struct;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             ShortcutItem.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (SquareItem != null && __isset.squareItem)
         {
             field.Name = "squareItem";
             field.Type = TType.Struct;
             field.ID   = 9;
             oprot.WriteFieldBegin(field);
             SquareItem.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (SquareCategoryItem != null && __isset.squareCategoryItem)
         {
             field.Name = "squareCategoryItem";
             field.Type = TType.Struct;
             field.ID   = 10;
             oprot.WriteFieldBegin(field);
             SquareCategoryItem.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }