In this paper, we investigate the Gowers U 2 norm for generalized Boolean functions, and Z-bent functions. The Gowers U 2 norm of a function is a measure of its resistance to affine approximation. Although nonlinearity serves the same purpose for the classical Boolean functions, it does not extend easily to generalized Boolean functions. We first provide a framework for employing the Gowers U 2 norm in the context of generalized Boolean functions with cryptographic significance, in particular, we give a recurrence rule for the Gowers U 2 norms, and an evaluation of the Gowers U 2 norm of functions that are affine over spreads. We also give an introduction to Z-bent functions, as proposed by Dobbertin and Leander [8], to provide a recursive framework to study bent functions. In the second part of the paper, we concentrate on Zbent functions and their U 2 norms. As a consequence of one of our results, we give an alternate proof to a known theorem of Dobbertin and Leander, and also find necessary and sufficient conditions for a function obtained by gluing Z-bent functions to be bent, in terms of the Gowers U 2 norms of its components.