public Builder addUpgrades(org.bwapi.proxy.messages.GameMessages.UpgradeType value) {
        if (upgradesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureUpgradesIsMutable();
          upgrades_.add(value);
          onChanged();
        } else {
          upgradesBuilder_.addMessage(value);
        }
        return this;
      }