@Nullable
    private String validateAndGeneratePassword(@Nullable String password) {
        return switch (passwordPolicy) {
            case USER_INPUT_REQUIRED -> {
                if (password == null) {
                    throw ResponseException.get(ResponseStatusCode.ILLEGAL_ARGUMENT,
                            "The password is required");
                } else {
                    Validator.inOptionalLengthRange(password,
                            "password",
                            passwordMinLength,
                            passwordMaxLength);
                    yield password;
                }
            }
            case USER_INPUT_OPTIONAL -> {
                Validator.inOptionalLengthRange(password,
                        "password",
                        passwordMinLength,
                        passwordMaxLength);
                yield password;
            }
            case USER_INPUT_OR_SYSTEM_GENERATED -> {
                if (password == null) {
                    yield generatePassword();
                }
                Validator.inOptionalLengthRange(password,
                        "password",
                        passwordMinLength,
                        passwordMaxLength);
                yield password;
            }
            case SYSTEM_GENERATED -> generatePassword();
            case PROHIBITED -> throw ResponseException.get(ResponseStatusCode.ILLEGAL_ARGUMENT,
                    "The password is prohibited");
        };
    }
@implNote Though the range of the ID is [0, 1,000,000,000), we still use long as it is easy
          to extend the ID range if we need in the future, e.g.: extend to 10 digits.
turms-service/src/main/java/im/turms/service/domain/conference/service/ConferenceService.java