I have a custom class that acts as an int called Integer, I would like to tell compiler how to convert certain types to Integer automatically so that I can avoid typing same
You could define constructors in Integer for those types you want to implicitly convert. Do not make them explicit.
explicit