How can I show that the below function is convex in $x$ and convex in $e$? $x_1 , x_2\geq 0$ and $e$ is a random variable which has a limited expectation.
\begin{equation} Q(x,e)=\begin{cases} 1-x_1 & 0\leq e <x_1+x_2\\ e+1-2x_1-x_2 & x_1+x_2 \leq e <1+x_2\\ 2(e-x_1-x_2) & 1+x_2\leq e \end{cases} \end{equation}