Check parameters for validity and assign global static variables.

@param paramBuilder
{@link Builder} reference
10385
private static void checkParams(final Builder paramBuilder) {
        checkState(paramBuilder.mSession != null && paramBuilder.mKey >= 0 && paramBuilder.mNewRev >= 0
            && paramBuilder.mOldRev >= 0 && paramBuilder.mObservers != null && paramBuilder.mKind != null,
            "No valid arguments specified!");
        checkState(
            paramBuilder.mNewRev != paramBuilder.mOldRev && paramBuilder.mNewRev >= paramBuilder.mOldRev,
            "Revision numbers must not be the same and the new revision must have a greater number than the old revision!");
    }
489415
public VarValueDefBuilder has( String name, Object value)
    {
    varValueDef_.setAnnotation( name, Objects.toString( value, null));
    return this;
    }
622881
protected function checkParams()
    {
        if ((null === $this->jar) or !file_exists($this->jar)) {
            throw new BuildException(
                sprintf(
                    'Specify the name of the LiquiBase.jar. "%s" does not exist!',
                    $this->jar
                )
            );
        }

        $this->checkChangeLogFile();

        if (null === $this->classpathref) {
            throw new BuildException('Please provide a classpath!');
        }

        if (null === $this->username) {
            throw new BuildException('Please provide a username for database acccess!');
        }

        if (null === $this->password) {
            throw new BuildException('Please provide a password for database acccess!');
        }

        if (null === $this->url) {
            throw new BuildException('Please provide a url for database acccess!');
        }
    }
833749
ParamBuilder getBuilderForParam(TypeMirror typeMirror) {
        ParamBuilder paramBuilder = typeBuilderMap.get(typeMirror);
        if (paramBuilder == null) {
            switch (typeMirror.getKind()) {
                case BOOLEAN:
                    paramBuilder = new BooleanParamBuilder(messager, null);
                    break;
                case BYTE:
                    paramBuilder = new ByteParamBuilder(messager, null);
                    break;
                case CHAR:
                    paramBuilder = new CharParamBuilder(messager, null);
                    break;
                case DOUBLE:
                    paramBuilder = new DoubleParamBuilder(messager, null);
                    break;
                case FLOAT:
                    paramBuilder = new FloatParamBuilder(messager, null);
                    break;
                case INT:
                    paramBuilder = new IntParamBuilder(messager, null);
                    break;
                case LONG:
                    paramBuilder = new LongParamBuilder(messager, null);
                    break;
                case SHORT:
                    paramBuilder = new ShortParamBuilder(messager, null);
                    break;
                case ARRAY:
                    paramBuilder = getBuilderForParam(((ArrayType) typeMirror).getComponentType());
                    break;
                case DECLARED:
                    TypeElement genericList = getGenericType(typeMirror);
                    if (genericList != null) {
                        paramBuilder = new ListOfParcelerParamBuilder(messager, null, genericList);
                    } else if (typeUtils.isAssignable(typeMirror, stringTypeMirror)) {
                        paramBuilder = new StringParamBuilder(messager, null);
                    } else if (typeUtils.isAssignable(typeMirror, charSequenceTypeMirror)) {
                        paramBuilder = new CharSequenceParamBuilder(messager, null);
                    } else if (typeUtils.isAssignable(typeMirror, listTypeMirror) || typeMirror.toString().equals("java.util.List<java.lang.String>")) {
                        paramBuilder = new ListParamBuilder(messager, null);
                    } else if (typeUtils.isAssignable(typeMirror, mapTypeMirror)) {
                        paramBuilder = new MapParamBuilder(messager, null);
                    } else if (typeUtils.isAssignable(typeMirror, parcellableTypeMirror)) {
                        paramBuilder = new ParcellableParamBuilder(messager, null);
                    } else {
                        String typeName = typeMirror.toString();
                        int templateStart = typeName.indexOf('<');
                        if (templateStart != -1) {
                            typeName = typeName.substring(0, templateStart).trim();
                        }
                        TypeElement typeElement = elementUtils.getTypeElement(typeName);
                        if (typeElement != null) {
                            if (typeElement.getKind() == ElementKind.INTERFACE && typeElement.getAnnotation(Remoter.class) != null) {
                                paramBuilder = new BinderParamBuilder(messager, null);
                            } else if (parcelClass != null && typeElement.getAnnotation(parcelClass) != null) {
                                paramBuilder = new ParcelerParamBuilder(messager, null);
                            }
                        }
                    }
                    break;
            }
            if (paramBuilder != null) {
                paramBuilder.setBindingManager(this);
                typeBuilderMap.put(typeMirror, paramBuilder);
            } else {
                paramBuilder = new GenericParamBuilder(messager, null);
                paramBuilder.setBindingManager(this);
                typeBuilderMap.put(typeMirror, paramBuilder);
            }
        }
        return paramBuilder;
    }
779040
private function checkParams()
    {
        if ($this->file === null && empty($this->filesets) && empty($this->dirsets)) {
            throw new BuildException(
                "Specify at least one source - a file, dirset or a fileset."
            );
        }

        if ($this->mode === null) {
            throw new BuildException("You have to specify an octal mode for chmod.");
        }

        // check for mode to be in the correct format
        if (!preg_match('/^([0-7]){3,4}$/', $this->mode)) {
            throw new BuildException("You have specified an invalid mode.");
        }
    }
378372
public static void setConstructorArgValue(BeanDefinitionBuilder builder, String propertyValue) {
        if (StringUtils.hasText(propertyValue)) {
            builder.addConstructorArgValue(propertyValue);
        }
    }
1374607
static void initSingleParam(String key, String initValue, DbConn cnx)
    {
        try
        {
            cnx.runSelectSingle("globalprm_select_by_key", 2, String.class, key);
            return;
        }
        catch (NoResultException e)
        {
            GlobalParameter.create(cnx, key, initValue);
        }
        catch (NonUniqueResultException e)
        {
            // It exists! Nothing to do...
        }
    }
1315031
public void build(final GroovyObject builder) {
        final String[] s = getStrings();
        final int numberOfValues = values.length;

        for (int i = 0, size = s.length; i < size; i++) {
            builder.getProperty("mkp");
            builder.invokeMethod("yield", new Object[]{s[i]});
            if (i < numberOfValues) {
                builder.getProperty("mkp");
                builder.invokeMethod("yield", new Object[]{values[i]});
            }
        }
    }
91482
public static void checkNullTypedParams(String url, ApiRequestParams params) {
    if (params == null) {
      throw new IllegalArgumentException(String.format("Found null params for %s. "
          + "Please pass empty params using param builder via `builder().build()` instead.", url
      ));
    }
  }
355019
@Override
    protected void addBuildInfoProperties(BuildInfoBuilder builder) {
        if (envVars != null) {
            for (Map.Entry<String, String> entry : envVars.entrySet()) {
                builder.addProperty(BuildInfoProperties.BUILD_INFO_ENVIRONMENT_PREFIX + entry.getKey(), entry.getValue());
            }
        }

        if (sysVars != null) {
            for (Map.Entry<String, String> entry : sysVars.entrySet()) {
                builder.addProperty(entry.getKey(), entry.getValue());
            }
        }
    }
774538
ArgumentsBuilder param(String param, String value) {
        if (value != null) {
            args.add(param);
            args.add(value);
        }
        return this;
    }
923468
protected void generateIFormalParameterBuilder() {
		final TypeReference builder = getFormalParameterBuilderInterface();
		final StringConcatenationClient content = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation it) {
				it.append("/** Builder of a " + getLanguageName() //$NON-NLS-1$
						+ " formal parameter."); //$NON-NLS-1$
				it.newLine();
				it.append(" */"); //$NON-NLS-1$
				it.newLine();
				it.append("@SuppressWarnings(\"all\")"); //$NON-NLS-1$
				it.newLine();
				it.append("public interface "); //$NON-NLS-1$
				it.append(builder.getSimpleName());
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append(generateMembers(true, false));
				it.append("}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
			}
		};
		final JavaFileAccess javaFile = getFileAccessFactory().createJavaFile(builder, content);
		javaFile.writeTo(getSrcGen());
	}
51243
protected void generateTypeParameterBuilderImpl() {
		final TypeReference builderInterface = getTypeParameterBuilderInterface();
		final TypeReference builder = getTypeParameterBuilderImpl();
		final StringConcatenationClient content = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation it) {
				it.append("/** Builder of a " + getLanguageName() //$NON-NLS-1$
					+ " type parameter."); //$NON-NLS-1$
				it.newLine();
				it.append(" */"); //$NON-NLS-1$
				it.newLine();
				it.append("@SuppressWarnings(\"all\")"); //$NON-NLS-1$
				it.newLine();
				it.append("public class "); //$NON-NLS-1$
				it.append(builder.getSimpleName());
				it.append(" extends "); //$NON-NLS-1$
				it.append(getAbstractBuilderImpl());
				it.append(" implements "); //$NON-NLS-1$
				it.append(builderInterface);
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append(generateMembers(false, false));
				it.append("}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
			}
		};
		final JavaFileAccess javaFile = getFileAccessFactory().createJavaFile(builder, content);
		javaFile.writeTo(getSrcGen());
	}
663902
@Override
    public boolean parseParameters(Object params)
    {
        if (params == null || !(params instanceof BuildBattleDecorator))
            return false;

        this.params = (BuildBattleDecorator) params;

        this.sourceBounds = this.params.getGoalStructureBounds();
        this.destBounds = this.params.getPlayerStructureBounds();
        this.delta = new Vec3i(destBounds.getMin().getX() - sourceBounds.getMin().getX(),
                               destBounds.getMin().getY() - sourceBounds.getMin().getY(),
                               destBounds.getMin().getZ() - sourceBounds.getMin().getZ());
        
        this.structureVolume = volumeOfBounds(this.sourceBounds);
        assert(this.structureVolume == volumeOfBounds(this.destBounds));
        this.dest = new ArrayList<IBlockState>(Collections.nCopies(this.structureVolume, (IBlockState)null));
        this.source = new ArrayList<IBlockState>(Collections.nCopies(this.structureVolume, (IBlockState)null));
        
        DrawBlockBasedObjectType tickBlock = this.params.getBlockTypeOnCorrectPlacement();
        DrawBlockBasedObjectType crossBlock = this.params.getBlockTypeOnIncorrectPlacement();

        this.blockTypeOnCorrectPlacement = (tickBlock != null) ? new XMLBlockState(tickBlock.getType(), tickBlock.getColour(), tickBlock.getFace(), tickBlock.getVariant()) : null;
        this.blockTypeOnIncorrectPlacement = (crossBlock != null) ? new XMLBlockState(crossBlock.getType(), crossBlock.getColour(), crossBlock.getFace(), crossBlock.getVariant()) : null;
        return true;
    }
79508
@SuppressWarnings("deprecation")
    public final void doBuildWithParameters(StaplerRequest req, StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, ServletException {
        hudson.model.BuildAuthorizationToken.checkPermission(asJob(), asJob().getAuthToken(), req, rsp);

        ParametersDefinitionProperty pp = asJob().getProperty(ParametersDefinitionProperty.class);
        if (!asJob().isBuildable()) {
            throw HttpResponses.error(SC_CONFLICT, new IOException(asJob().getFullName() + " is not buildable!"));
        }
        if (pp != null) {
            pp.buildWithParameters(req, rsp, delay);
        } else {
            throw new IllegalStateException("This build is not parameterized!");
        }
    }
1135269
public void setQueryParamsBuilds(QueryParamsBuilder queryParamsBuilder) {
		PreconditionUtil.assertNotNull("A query params builder must be provided, but is null", queryParamsBuilder);
		this.queryParamsBuilder = queryParamsBuilder;
		this.querySpecDeserializer = null;
	}
686214
protected void writeArrayOutParamsToProxy(VariableElement param, MethodSpec.Builder methodBuilder) {
        methodBuilder.beginControlFlow("if (" + param.getSimpleName() + " == null)");
        methodBuilder.addStatement("data.writeInt(-1)");
        methodBuilder.endControlFlow();
        methodBuilder.beginControlFlow("else");
        methodBuilder.addStatement("data.writeInt(" + param.getSimpleName() + ".length)");
        methodBuilder.endControlFlow();
    }