Will this help?
Integer.parseInt("00ff00", 16)
16 means that you should interpret the string as 16-based (hexadecimal). By using 2 you can parse binary number, 8 stands for octal. 10 is default and parses decimal numbers.
In your case Integer.parseInt(primary.getFullHex(), 16) won’t work due to 0x prefix prepended by getFullHex() – get rid of and you’ll be fine.