code: public static Display getDisplay(int mode) {
          if (mode == 0)
              return Display.Required;
          else if (mode == 1)
              return Display.Optional;
          else if (mode == 2)
              return Display.ReadOnly;
          else if (mode == 3)
              return Display.Hidden;
          else
              return null;
      }
docs: Maps VariableVO display mode to Display type.