Throws a ParameterException unless exactly one parameter is defined.
328513
public void assertExactlyOneDefined(final String... params) {
    int definedCount = 0;
    for (final String param : params) {
      if (isPresent(param)) {
        if (++definedCount == 2) {
          // No point in going past two
          break;
        }
      }
    }
    if (definedCount != 1) {
      throw new ParameterException(
          String.format("Exactly one of %s must be defined.",
              StringUtils.CommaSpaceJoiner.join(params)));
    }
  }
1276191
public static void assertTrueOrUnknownParamInJQLException(boolean expression, SQLiteModelMethod method,
			String paramName) {
		if (!expression) {
			throw (new UnknownParamUsedInJQLException(method, paramName));
		}
	}
282544
protected void assertPathParamArgsCountMatches(ActionExecute execute, String paramPath, List<Class<?>> pathParamTypeList,
            Map<Integer, Object> pathParamValueMap) {
        if (pathParamTypeList.size() != pathParamValueMap.size()) {
            throwPathParamArgsDifferentCountException(execute, paramPath, pathParamTypeList, pathParamValueMap);
        }
    }
1370621
private synchronized void checkPath(String logPath) throws ParameterException {
		Validate.notNull(path);
		File cPath = new File(logPath);
		if(!cPath.exists())
			cPath.mkdirs();
		if(!cPath.isDirectory())
			throw new ParameterException(ErrorCode.INCOMPATIBILITY, logPath + " is not a valid path!");
	}
1062587
@Override
    public void validate(String name, String value) throws ParameterException {
        if(!value.equals(ArbiterCliRunner.MULTI_LAYER_NETWORK) || value.equals(ArbiterCliRunner.COMP_GRAPH)) {
            throw new ParameterException("Neural net type can only be " + ArbiterCliRunner.COMP_GRAPH + " or " + ArbiterCliRunner.MULTI_LAYER_NETWORK);

        }
    }
900698
public static void validateParams(Object... params) throws JinxException {
        for (Object o : params) {
            if (o == null) {
                throw new JinxException("Parameters cannot be null.");
            } else if (o instanceof List) {
                for (Object listObject : (List) o) {
                    if (listObject == null) {
                        throw new JinxException("Objects in list cannot be null.");
                    }
                }
            } else if (o instanceof String) {
                if (((String) o).trim().length() == 0) {
                    throw new JinxException("String cannot be empty.");
                }
            }
        }
    }
1238655
def setParameter(self, parameterName, index, parameterValue):
    
    if hasattr(self, parameterName):
      setattr(self, parameterName, parameterValue)
    else:
      raise Exception("Unknown parameter: " + parameterName)
796251
public static void validateStringValue(String value) throws ParameterException {
		Validate.notNull(value);
		Validate.notEmpty(value);
	}
381688
private Object doAroundInterceptor() throws Exception {
        // Note, we do not call setParameters since the assumption is the
        // wrapper code passes an Object array that always contains the
        // correct type.  If we want type checking to ensure wrapper
        // code is correct, we could call setParameters(parameters) instead
        // of just doing assignment here.
        ivNextIndex = 0;
        ivNumberOfInterceptors = ivInterceptorProxies == null ? 0 : ivInterceptorProxies.length;
        ivParametersModified = false; //LIDB3294-41
        return proceed();
    }
1171397
@Override
    public void setString(String parameterName, String x) throws SQLException
    {
        checkClosed();
        throw SQLError.noSupport();
    }
948558
private void initParameters(ProcessingParameters pParams) {
        processingConfig = pParams;
        String ignoreErrors = processingConfig.get(ConfigKey.IGNORE_ERRORS);
        if (ignoreErrors != null && ignoreErrors.matches("^(true|yes|on|1)$")) {
            valueFaultHandler = ValueFaultHandler.IGNORING_VALUE_FAULT_HANDLER;
        } else {
            valueFaultHandler = ValueFaultHandler.THROWING_VALUE_FAULT_HANDLER;
        }
    }
788366
public static void throwException(Throwable t) {
        if (hasUnsafe()) {
            PlatformDependent0.throwException(t);
        } else {
            PlatformDependent.<RuntimeException>throwException0(t);
        }
    }
374106
private void throwExIntParam(MethodVisitor mv, Class<?> exCls) {
		String exSig = Type.getInternalName(exCls);
		mv.visitTypeInsn(NEW, exSig);
		mv.visitInsn(DUP);
		mv.visitLdcInsn("mapping " + this.className + " failed to map field:");
		mv.visitVarInsn(ILOAD, 2);
		mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "toString", "(I)Ljava/lang/String;");
		mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "concat", "(Ljava/lang/String;)Ljava/lang/String;");
		mv.visitMethodInsn(INVOKESPECIAL, exSig, "<init>", "(Ljava/lang/String;)V");
		mv.visitInsn(ATHROW);
	}
996572
private void checkIndex(int parameterIndex, boolean fetchingData) throws SQLException {
    if (!isFunction) {
      throw new PSQLException(
          GT.tr(
              "A CallableStatement was declared, but no call to registerOutParameter(1, <some type>) was made."),
          PSQLState.STATEMENT_NOT_ALLOWED_IN_FUNCTION_CALL);
    }

    if (fetchingData) {
      if (!returnTypeSet) {
        throw new PSQLException(GT.tr("No function outputs were registered."),
            PSQLState.OBJECT_NOT_IN_STATE);
      }

      if (callResult == null) {
        throw new PSQLException(
            GT.tr("Results cannot be retrieved from a CallableStatement before it is executed."),
            PSQLState.NO_DATA);
      }

      lastIndex = parameterIndex;
    }
  }
1103326
public static void parameterNotEmpty(final String name, final Iterable obj) {
        if (!obj.iterator().hasNext()) {
            raiseError(format("Parameter '%s' from type '%s' is expected to NOT be empty", name, obj.getClass().getName()));
        }
    }
20099
private int onException(Exception e) throws IOException {
        eofReached = true;
        if (e instanceof IOException) {
            throw (IOException) e;
        } else if (e instanceof RuntimeException) {
            throw (RuntimeException) e;
        } else {
            // Impossible since InputStream throws no other checked exceptions.
            throw Throwables.failure(e);
        }
    }
419234
public static void isTrue(Boolean expression) {
		if(!validation) return;
		notNull(expression);
		if(!expression)
			throw new ParameterException(ErrorCode.CONSTRAINT);
	}