code: public void setIsRequired(boolean required) {
          if (! required) {
              validators.remove(REQUIRED_FIELD_VALIDATOR);
          } else if (! isRequired()) {
              validators.add(REQUIRED_FIELD_VALIDATOR);
          }
      }
docs: Sets whether this field is required to have user input.
  
  @param required  if true, this field checks for a non-empty or non-null value upon validation. Otherwise, this
  field can be empty.