Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
<!-- begin-user-doc -->
<!-- end-user-doc -->
@return the first non-null result returned by a <code>caseXXX</code> call.
@generated
161456
protected T doSwitch(int classifierID, EObject theEObject) {
		switch (classifierID) {
			case DroolsPackage.DOCUMENT_ROOT: {
				DocumentRoot documentRoot = (DocumentRoot)theEObject;
				T result = caseDocumentRoot(documentRoot);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case DroolsPackage.GLOBAL_TYPE: {
				GlobalType globalType = (GlobalType)theEObject;
				T result = caseGlobalType(globalType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case DroolsPackage.IMPORT_TYPE: {
				ImportType importType = (ImportType)theEObject;
				T result = caseImportType(importType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case DroolsPackage.META_DATA_TYPE: {
				MetaDataType metaDataType = (MetaDataType)theEObject;
				T result = caseMetaDataType(metaDataType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case DroolsPackage.ON_ENTRY_SCRIPT_TYPE: {
				OnEntryScriptType onEntryScriptType = (OnEntryScriptType)theEObject;
				T result = caseOnEntryScriptType(onEntryScriptType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case DroolsPackage.ON_EXIT_SCRIPT_TYPE: {
				OnExitScriptType onExitScriptType = (OnExitScriptType)theEObject;
				T result = caseOnExitScriptType(onExitScriptType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			default: return defaultCase(theEObject);
		}
	}
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();
	}
19014
@Nonnull
	public <V extends T> LObjIntCharFunctionBuilder<T, R> casesOf(Class<V> argC1, Consumer<LObjIntCharFunctionBuilder<V, R>> pcpConsumer) {
		PartialCaseWithProduct.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)));

		pc.specifySubCases((Consumer) pcpConsumer);
		return self();
	}
938122
@Override
	public String initValues(final FieldCase ca) {
		if (ca != null) {
			/*
			 * If a FieldCase is given all fields will be generated anew, independent of the case
			 * combination.
			 */
			for (Constraint c : constraints) {
				c.resetValues();
			}
		}
		for (Constraint c : constraints) {
			c.initValues(ca);
		}
		return null;
	}
381555
@Override
    public Collection<ProcessInstanceDesc> getProcessInstancesForCase(String caseId, QueryContext queryContext) {
        CorrelationKey correlationKey = correlationKeyFactory.newCorrelationKey(caseId);
        
        return runtimeDataService.getProcessInstancesByCorrelationKey(correlationKey, queryContext);        
    }
1177888
@Override
	public Class<?> getColumnClass(int columnIndex) {
		switch (columnIndex) {
		case 0:
			return Boolean.class;
		case 1:
			return String.class;
		case 2:
			return String.class;
		case 3:
			return Integer.class;
		}
		return null;
	}
628714
public List<CaseStageInstance> internalGetCaseStages(CaseDefinition caseDef, String caseId, boolean activeOnly, QueryContext queryContext) {
        
        CorrelationKey correlationKey = correlationKeyFactory.newCorrelationKey(caseId);
        Collection<org.jbpm.services.api.model.NodeInstanceDesc> nodes = runtimeDataService.getNodeInstancesByCorrelationKeyNodeType(correlationKey, 
                                                                                            Arrays.asList(ProcessInstance.STATE_ACTIVE), 
                                                                                            Arrays.asList("DynamicNode"), 
                                                                                            queryContext);
        Collection<Long> completedNodes = nodes.stream().filter(n -> ((NodeInstanceDesc)n).getType() == 1).map(n -> n.getId()).collect(toList());
        
        Map<String, CaseStage> stagesByName = caseDef.getCaseStages().stream()
        .collect(toMap(CaseStage::getId, c -> c)); 
        Predicate<org.jbpm.services.api.model.NodeInstanceDesc> filterNodes = null;
        if (activeOnly) {
            
            filterNodes = n -> ((NodeInstanceDesc)n).getType() == 0 && !completedNodes.contains(((NodeInstanceDesc)n).getId());             
        } else {
            filterNodes = n -> ((NodeInstanceDesc)n).getType() == 0;
        }
        
        List<String> triggeredStages = new ArrayList<>();
        List<CaseStageInstance> stages = new ArrayList<>();
        nodes.stream()
        .filter(filterNodes)
        .map(n -> {
            StageStatus status = StageStatus.Active;
            if (completedNodes.contains(((NodeInstanceDesc)n).getId())) {
                status = StageStatus.Completed;
            }
            Collection<org.jbpm.services.api.model.NodeInstanceDesc> activeNodes = getActiveNodesForCaseAndStage(caseId, n.getNodeId(), new QueryContext(0, 100));
            return new CaseStageInstanceImpl(n.getNodeId(), n.getName(), stagesByName.get(n.getNodeId()).getAdHocFragments(), activeNodes, status);
            })
        .forEach(csi -> {
            stages.add(csi);
            triggeredStages.add(csi.getName());                        
        });
        
        
        if (!activeOnly) {
            // add other stages that are present in the definition            
            caseDef.getCaseStages().stream()
            .filter(cs -> !triggeredStages.contains(cs.getName()))
            .map(cs -> new CaseStageInstanceImpl(cs.getId(), cs.getName(), cs.getAdHocFragments(), Collections.emptyList(), StageStatus.Available))
            .forEach(csi -> stages.add(csi));
        }
        
        return stages;
    }
1239290
private static MethodRef getOneOfCaseMethod(OneofDescriptor descriptor) {
    TypeInfo message = messageRuntimeType(descriptor.getContainingType());
    return MethodRef.createInstanceMethod(
            message,
            new Method(
                "get" + underscoresToCamelCase(descriptor.getName(), true) + "Case",
                TypeInfo.create(JavaQualifiedNames.getCaseEnumClassName(descriptor)).type(),
                NO_METHOD_ARGS))
        .asCheap();
  }
319821
@Override
  protected T doSwitch(int classifierID, EObject theEObject)
  {
    switch (classifierID)
    {
      case SimpleExpressionsPackage.IF_CONDITION:
      {
        IfCondition ifCondition = (IfCondition)theEObject;
        T result = caseIfCondition(ifCondition);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SimpleExpressionsPackage.EXPRESSION:
      {
        Expression expression = (Expression)theEObject;
        T result = caseExpression(expression);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SimpleExpressionsPackage.NUMBER_LITERAL:
      {
        NumberLiteral numberLiteral = (NumberLiteral)theEObject;
        T result = caseNumberLiteral(numberLiteral);
        if (result == null) result = caseExpression(numberLiteral);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SimpleExpressionsPackage.BOOLEAN_LITERAL:
      {
        BooleanLiteral booleanLiteral = (BooleanLiteral)theEObject;
        T result = caseBooleanLiteral(booleanLiteral);
        if (result == null) result = caseExpression(booleanLiteral);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SimpleExpressionsPackage.METHOD_CALL:
      {
        MethodCall methodCall = (MethodCall)theEObject;
        T result = caseMethodCall(methodCall);
        if (result == null) result = caseExpression(methodCall);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SimpleExpressionsPackage.OR_EXPRESSION:
      {
        OrExpression orExpression = (OrExpression)theEObject;
        T result = caseOrExpression(orExpression);
        if (result == null) result = caseExpression(orExpression);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SimpleExpressionsPackage.AND_EXPRESSION:
      {
        AndExpression andExpression = (AndExpression)theEObject;
        T result = caseAndExpression(andExpression);
        if (result == null) result = caseExpression(andExpression);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SimpleExpressionsPackage.COMPARISON:
      {
        Comparison comparison = (Comparison)theEObject;
        T result = caseComparison(comparison);
        if (result == null) result = caseExpression(comparison);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SimpleExpressionsPackage.NOT_EXPRESSION:
      {
        NotExpression notExpression = (NotExpression)theEObject;
        T result = caseNotExpression(notExpression);
        if (result == null) result = caseExpression(notExpression);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      default: return defaultCase(theEObject);
    }
  }
1113310
@SuppressWarnings("unchecked")
  T result(final Object r) {
    return (T) (r == NULL ? null : r);
  }
267518
@Override
    public int caseMap(IntHolder flagP, byte[] bytes, IntHolder pp, int end, byte[] to, int toP, int toEnd) {
        return singleByteAsciiOnlyCaseMap(flagP, bytes, pp, end, to, toP, toEnd);
    }
1114488
@Override
    public final Class<T> returnedClass() {
        @SuppressWarnings("unchecked")Class<T> result = (Class<T>) TypeHelper.getTypeArguments(AbstractColumnMapper.class, getClass()).get(0);
        return result;
    }
580871
public final Type getResultType() {
		Type type = resultTypeToken.getType();
		if (type instanceof Class || type instanceof ParameterizedType || type instanceof GenericArrayType) {
			return type;
		} else {
			throw new IllegalArgumentException("Cannot resolve result type: "+resultTypeToken);
		}
	}
396838
@Nonnull
	public final LCharSupplier build() {

		final LCharSupplier eventuallyFinal = this.eventually;

		LCharSupplier retval;

		final Case<LBoolSupplier, LCharSupplier>[] casesArray = cases.toArray(new Case[cases.size()]);
		retval = LCharSupplier.charSup(() -> {
			try {
				for (Case<LBoolSupplier, LCharSupplier> aCase : casesArray) {
					if (aCase.casePredicate().getAsBool()) {
						return aCase.caseFunction().getAsChar();
					}
				}

				return eventuallyFinal.getAsChar();
			} catch (Error e) { // NOSONAR
					throw e;
				} catch (Throwable e) { // NOSONAR
					throw Handler.handleOrPropagate(e, handling);
				}
			});

		if (consumer != null) {
			consumer.accept(retval);
		}
		return retval;
	}
918656
public Main.Result doCall() {
        try {
            return handleExceptions(() -> {
                prepareCompiler(false);
                if (compiler.errorCount() > 0)
                    return Main.Result.ERROR;
                compiler.compile(args.getFileObjects(), args.getClassNames(), processors, addModules);
                return (compiler.errorCount() > 0) ? Main.Result.ERROR : Main.Result.OK; // FIXME?
            }, Main.Result.SYSERR, Main.Result.ABNORMAL);
        } finally {
            try {
                cleanup();
            } catch (ClientCodeException e) {
                throw new RuntimeException(e.getCause());
            }
        }
    }
1138820
function() {
      switch (this.type) {
        case _Numeric:
        case _String:
        case _RegularExpression:
        case _Boolean:
        case _Null:
          return this.parseLiteral();
        case _Identifier:
          return this.parseIdentifier();
        case _Keyword:
          return this.parsePrimaryKeywordExpression();
        case _Punctuator:
          return this.parsePrimaryPunctuatorExpression();
        case _Template:
          return this.parseTemplateLiteral();
        default:
          this.unexpected();
      }
    }
528942
public TestResult getFirstNonSuccessfulResult() {
        for (ResponsePayload payload : payloads.values()) {

            if (payload != null) {

                TestResult testResult = payload.getTestResult();

                if (testResult != null) {
                    switch (testResult.getStatus()) {
                        case FAILED:
                            return testResult;
                        case SKIPPED:
                            return testResult;
                        case PASSED:
                    }
                }
            }
        }

        return null;
    }