Adds a switch case statement to the end of the list.
@throws IllegalArgumentException} if switchCase is {@code null}
769149
public void addCase(SwitchCase switchCase) {
        assertNotNull(switchCase);
        if (cases == null) {
            cases = new ArrayList<SwitchCase>();
        }
        cases.add(switchCase);
        switchCase.setParent(this);
    }
345862
public SwitchBlock<T, R> Case(T ca, def<R> func) {
                if (!found) {
                        if (method.applyCheckPrimitive(boolean.class, toSwitch, ca)) {
                                res = func.apply();
                                found = true;
                        }
                }
                return this;
        }
632293
@Nonnull
	public <V extends T> LConsumerBuilder<T> casesOf(Class<V> argC, Consumer<LConsumerBuilder<V>> pcpConsumer) {
		PartialCase.The pc = partialCaseFactoryMethod(a -> (argC == null || argC.isInstance(a)));

		pc.specifySubCases((Consumer) pcpConsumer);
		return self();
	}
1282041
@SuppressWarnings("fallthrough")
    @SuppressFBWarnings(justification = "As this is an encoding method the fallthrough is intentional", value = {"SF_SWITCH_NO_DEFAULT"})
    public static void appendEscapedLuceneQuery(StringBuilder buf,
            final CharSequence text) {

        if (text == null || buf == null) {
            return;
        }

        for (int i = 0; i < text.length(); i++) {
            final char c = text.charAt(i);
            switch (c) {
                case '+':
                case '-':
                case '&':
                case '|':
                case '!':
                case '(':
                case ')':
                case '{':
                case '}':
                case '[':
                case ']':
                case '^':
                case '"':
                case '~':
                case '*':
                case '?':
                case ':':
                case '/':
                case '\\': //it is supposed to fall through here
                    buf.append('\\');
                default:
                    buf.append(c);
                    break;
            }
        }
    }
885960
private function _processSwitchStop() {
		// If we already are in a "case", we remove it from the stack
		if ($this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_CASE || $this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_DEFAULT) {

			// Test if the previous case had a break
			$this->_checkSwitchCaseNeedBreak();

			$this->statementStack->pop();
		}

		$this->_checkSwitchNeedDefault();
	}
1113591
public void add(T value) {
        if (value == null)
            return;

        if (map.containsKey(value)) {
            map.put(value, map.get(value) + 1);
        } else {
            map.put(value, 1l);
        }
    }
805326
private final Switch switchStatement(Data data) throws TemplateException {
	if (!data.srcCode.forwardIfCurrent("switch", '(')) return null;

	Position line = data.srcCode.getPosition();

	comments(data);
	Expression expr = super.expression(data);
	comments(data);
	// end )
	if (!data.srcCode.forwardIfCurrent(')')) throw new TemplateException(data.srcCode, "switch statement must end with a [)]");
	comments(data);

	if (!data.srcCode.forwardIfCurrent('{')) throw new TemplateException(data.srcCode, "switch statement must have a starting  [{]");

	Switch swit = new Switch(expr, line, null);

	// cases
	// Node child=null;
	comments(data);
	while (caseStatement(data, swit)) {
	    comments(data);
	}
	// default
	if (defaultStatement(data, swit)) {
	    comments(data);
	}

	while (caseStatement(data, swit)) {
	    comments(data);
	}

	// }
	if (!data.srcCode.forwardIfCurrent('}')) throw new TemplateException(data.srcCode, "invalid construct in switch statement");
	swit.setEnd(data.srcCode.getPosition());
	return swit;
    }
441455
@Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        stack.pop();
        final String parentNode = stack.peek();
        if (null != parentNode) {
            switch (parentNode) {
                case PROJECT:
                    if (null != qName) {
                        switch (qName) {
                            case GROUPID:
                                model.setGroupId(currentText.toString());
                                break;
                            case ARTIFACTID:
                                model.setArtifactId(currentText.toString());
                                break;
                            case VERSION:
                                model.setVersion(currentText.toString());
                                break;
                            case NAME:
                                model.setName(currentText.toString());
                                break;
                            case DESCRIPTION:
                                model.setDescription(currentText.toString());
                                break;
                            case URL:
                                model.setProjectURL(currentText.toString());
                                break;
                            default:
                                break;
                        }
                    }
                    break;
                case ORGANIZATION:
                    if (NAME.equals(qName)) {
                        model.setOrganization(currentText.toString());
                    } else if (URL.equals(qName)) {
                        model.setOrganizationUrl(currentText.toString());
                    }
                    break;
                case PARENT:
                    if (null != qName) {
                        switch (qName) {
                            case GROUPID:
                                model.setParentGroupId(currentText.toString());
                                break;
                            case ARTIFACTID:
                                model.setParentArtifactId(currentText.toString());
                                break;
                            case VERSION:
                                model.setParentVersion(currentText.toString());
                                break;
                            default:
                                break;
                        }
                    }
                    break;
                case LICENSE:
                    if (license != null) {
                        if (NAME.equals(qName)) {
                            license.setName(currentText.toString());
                        } else if (URL.equals(qName)) {
                            license.setUrl(currentText.toString());
                        }
                    }
                    break;
                case LICENSES:
                    if (LICENSE.equals(qName) && license != null) {
                        model.addLicense(license);
                    }
                    break;
                default:
                    break;
            }
        }
    }
852631
public FacesConfigFlowDefinitionSwitchCaseType<FacesConfigFlowDefinitionSwitchType<T>> getOrCreateCase()
   {
      List<Node> nodeList = childNode.get("case");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigFlowDefinitionSwitchCaseTypeImpl<FacesConfigFlowDefinitionSwitchType<T>>(this, "case", childNode, nodeList.get(0));
      }
      return createCase();
   }
399152
public void addSentenceAsFirstOption(MtasCQLParserSentenceCondition s)
      throws ParseException {
    if (!simplified) {
      MtasCQLParserSentenceCondition sentenceCurrent;
      List<MtasCQLParserSentenceCondition> sentenceSequence;
      if (isBasic()) {
        if (basicSentence == null) {
          sentenceSequence = new ArrayList<MtasCQLParserSentenceCondition>();
          sentenceCurrent = s;
          sentenceSequence.add(sentenceCurrent);
          sequenceList.add(sentenceSequence);
          // not simple anymore
          basic = false;
        } else {
          // add sentence as first option
          sentenceSequence = new ArrayList<MtasCQLParserSentenceCondition>();
          sentenceCurrent = s;
          sentenceSequence.add(sentenceCurrent);
          sequenceList.add(sentenceSequence);
          // add previous basic sentence as new option
          sentenceSequence = new ArrayList<MtasCQLParserSentenceCondition>();
          sentenceCurrent = new MtasCQLParserSentenceCondition(basicSentence,
              ignore, maximumIgnoreLength);
          sentenceSequence.add(sentenceCurrent);
          sequenceList.add(sentenceSequence);
          basicSentence = null;
          // not simple anymore
          basic = false;
        }
      } else {
        sentenceSequence = new ArrayList<MtasCQLParserSentenceCondition>();
        sentenceCurrent = s;
        sentenceSequence.add(sentenceCurrent);
        List<List<MtasCQLParserSentenceCondition>> newsequenceList = new ArrayList<List<MtasCQLParserSentenceCondition>>();
        newsequenceList.add(sentenceSequence);
        newsequenceList.addAll(sequenceList);
        sequenceList = newsequenceList;
      }
    } else {
      throw new ParseException("already simplified");
    }
  }
157288
public SwitchBuilder addCase(Expression caseLabel, Statement body) {
    clauses.add(new Switch.CaseClause(ImmutableList.of(caseLabel), body));
    return this;
  }
141263
public static void addToListIfNotExists(List<String> list, String value) {
        boolean found = false;
        for (String item : list) {
            if (item.equalsIgnoreCase(value)) {
                found = true;
                break;
            }
        }
        if (!found) {
            list.add(value);
        }
    }
1124268
@Configurable
  public void addArg(String arg)
  {
    if (_args == null)
      _args = new ArrayList<String>();
    
    _args.add(arg);
  }
765956
private void add( final List<String> arguments,
                      final String argument )
    {
        if( argument != null && argument.trim().length() > 0 )
        {
            arguments.add( argument );
        }
    }
58554
public T add(String str) {
    requireNonNull(str, JVM_OPTION_NOT_NULL_ERROR_MESSAGE);
    String value = str.trim();
    if (isInvalidOption(value)) {
      throw new IllegalArgumentException("a JVM option can't be empty and must start with '-'");
    }
    checkMandatoryOptionOverwrite(value);
    options.add(value);

    return castThis();
  }
1017188
public final void addArgument(final String name, final Object value) {
        if (name == null) {
            throw new IllegalArgumentException("The argument 'name' cannot be null!");
        }
        if (value == null) {
            throw new IllegalArgumentException("The argument 'value' cannot be null!");
        }
        arguments.put(name.trim(), value);
    }
209800
public void setCases(List<SwitchCase> cases) {
        if (cases == null) {
            this.cases = null;
        } else {
            if (this.cases != null)
                this.cases.clear();
            for (SwitchCase sc : cases)
                addCase(sc);
        }
    }