Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1199

Union structs should have generated methods to test whether a specific field is currently set

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 0.7
    • Java - Compiler
    • None

    Description

      For example, in the following union

      union MyUnion {
        1: string my_field1;
        2: string my_field2;
      }
      

      it would be nice to be able to do something like boolean test = myUnion.is_my_field1; as an alternative to boolean test = (myUnion.getSetField() == _Fields.MY_FIELD1);

      Attachments

        1. thrift-1199.patch
          3 kB
          Piotr Kozikowski

        Activity

          People

            pkozikow Piotr Kozikowski
            pkozikow Piotr Kozikowski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: