Please solve the programming task below using a self-contained code snippet in a markdown code block.

You are given a positive integer num. You may swap any two digits of num that have the same parity (i.e. both odd digits or both even digits).
Return the largest possible value of num after any number of swaps.
 
Please complete the following python code precisely:
```python
class Solution:
    def largestInteger(self, num: int) -> int:
```