Yes. In that sense even casting has same cast. Instead of a boolean we can have  'mapredCompatibleInputFormat' var that gets initialized once.