Check type of primitive field

I’m trying to determine the type of a field on an object. I don’t know the type of the object when it is passed to me but I need to find fields which are longs. It is easy enough to distinguish the …