public Builder setUpgrades(
          int index, org.bwapi.proxy.messages.GameMessages.UpgradeType value) {
        if (upgradesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureUpgradesIsMutable();
          upgrades_.set(index, value);
          onChanged();
        } else {
          upgradesBuilder_.setMessage(index, value);
        }
        return this;
      }