public JvmType findInferredClass(final EObject pattern, final Class<?> clazz) { Set<EObject> _jvmElements = this.associations.getJvmElements(pattern); Iterable<JvmType> _filter = Iterables.<JvmType>filter(_jvmElements, JvmType.class); final Function1<JvmType, Boolean> _function = new Function1<JvmType, Boolean>() { @Override public Boolean apply(final JvmType it) { return Boolean.valueOf(EMFPatternLanguageJvmModelInferrerUtil.this.isCompatibleWith(it, clazz)); } }; return IterableExtensions.<JvmType>findFirst(_filter, _function); }
@Override public AnnotationTypeElementDeclaration findDeclaredAnnotationTypeElement(final String name) { final Function1<AnnotationTypeElementDeclaration, Boolean> _function = (AnnotationTypeElementDeclaration it) -> { String _simpleName = it.getSimpleName(); return Boolean.valueOf(Objects.equal(_simpleName, name)); }; return IterableExtensions.findFirst(this.getDeclaredAnnotationTypeElements(), _function); }
@Override public FieldDeclaration findDeclaredField(final String name) { final Function1<FieldDeclaration, Boolean> _function = (FieldDeclaration it) -> { String _simpleName = it.getSimpleName(); return Boolean.valueOf(Objects.equal(_simpleName, name)); }; return IterableExtensions.<FieldDeclaration>findFirst(Iterables.<FieldDeclaration>filter(this.getDeclaredMembers(), FieldDeclaration.class), _function); }
@Override public TypeDeclaration findDeclaredType(final String name) { final Function1<TypeDeclaration, Boolean> _function = (TypeDeclaration type) -> { String _simpleName = type.getSimpleName(); return Boolean.valueOf(Objects.equal(_simpleName, name)); }; return IterableExtensions.findFirst(this.getDeclaredTypes(), _function); }
@Override public AnnotationReference findAnnotation(final Type annotationType) { final Function1<AnnotationReference, Boolean> _function = (AnnotationReference it) -> { AnnotationTypeDeclaration _annotationTypeDeclaration = it.getAnnotationTypeDeclaration(); return Boolean.valueOf(Objects.equal(_annotationTypeDeclaration, annotationType)); }; return IterableExtensions.findFirst(this.getAnnotations(), _function); } }
@Override public EnumerationValueDeclaration findDeclaredValue(final String name) { final Function1<EnumerationValueDeclaration, Boolean> _function = (EnumerationValueDeclaration value) -> { String _simpleName = value.getSimpleName(); return Boolean.valueOf(Objects.equal(_simpleName, name)); }; return IterableExtensions.findFirst(this.getDeclaredValues(), _function); }
@Override public MutableAnnotationTypeElementDeclaration findDeclaredAnnotationTypeElement(final String name) { final Function1<MutableAnnotationTypeElementDeclaration, Boolean> _function = (MutableAnnotationTypeElementDeclaration it) -> { String _simpleName = it.getSimpleName(); return Boolean.valueOf(Objects.equal(_simpleName, name)); }; return IterableExtensions.findFirst(this.getDeclaredAnnotationTypeElements(), _function); }
public AnnotationReference findAnnotation(final Type annotationType) { final Function1<AnnotationReference, Boolean> _function = (AnnotationReference it) -> { AnnotationTypeDeclaration _annotationTypeDeclaration = it.getAnnotationTypeDeclaration(); return Boolean.valueOf(Objects.equal(_annotationTypeDeclaration, annotationType)); }; return IterableExtensions.findFirst(this.getAnnotations(), _function); } }
public TypeDeclaration findDeclaredType(final String name) { final Function1<TypeDeclaration, Boolean> _function = (TypeDeclaration type) -> { String _simpleName = type.getSimpleName(); return Boolean.valueOf(Objects.equal(_simpleName, name)); }; return IterableExtensions.findFirst(this.getDeclaredTypes(), _function); }
public static Grammar getNonTerminalsSuperGrammar(final Grammar grammar) { final Function1<Grammar, Boolean> _function = (Grammar it) -> { String _name = it.getName(); return Boolean.valueOf((!Objects.equal(_name, GrammarUtil2.TERMINALS))); }; return IterableExtensions.<Grammar>findFirst(grammar.getUsedGrammars(), _function); } }
@Override public AnnotationTypeElementDeclaration findDeclaredAnnotationTypeElement(final String name) { final Function1<AnnotationTypeElementDeclaration, Boolean> _function = (AnnotationTypeElementDeclaration it) -> { String _simpleName = it.getSimpleName(); return Boolean.valueOf(Objects.equal(_simpleName, name)); }; return IterableExtensions.findFirst(this.getDeclaredAnnotationTypeElements(), _function); }
public FieldDeclaration findDeclaredField(final String name) { final Function1<FieldDeclaration, Boolean> _function = (FieldDeclaration field) -> { String _simpleName = field.getSimpleName(); return Boolean.valueOf(Objects.equal(_simpleName, name)); }; return IterableExtensions.findFirst(this.getDeclaredFields(), _function); }
/** * Returns the aggregate variable the aggregator should work with. Given in a well-formed AggregatedValue only a * single aggregate variable should be present, this should be unique. */ public static VariableReference getAggregatorVariable(final AggregatedValue value) { return IterableExtensions.<VariableReference>findFirst(Iterables.<VariableReference>filter(PatternLanguageHelper.getCallParameters(value.getCall()), VariableReference.class), AggregatorUtil.aggregator); }
@Override public EnumerationValueDeclaration findDeclaredValue(final String name) { final Function1<EnumerationValueDeclaration, Boolean> _function = (EnumerationValueDeclaration value) -> { String _simpleName = value.getSimpleName(); return Boolean.valueOf(Objects.equal(_simpleName, name)); }; return IterableExtensions.findFirst(this.getDeclaredValues(), _function); } }
@Override public Path getSourceFolder(final Path path) { final Function1<Path, Boolean> _function = (Path sourceFolder) -> { return Boolean.valueOf(path.startsWith(sourceFolder)); }; return IterableExtensions.<Path>findFirst(this.getProjectSourceFolders(path), _function); }
protected TypedResponse getOKResponse(final Method method) { final Function1<TypedResponse, Boolean> _function = (TypedResponse it) -> { return Boolean.valueOf(((it.getStatusCode() >= 200) && (it.getStatusCode() < 300))); }; return IterableExtensions.<TypedResponse>findFirst(method.getResponses(), _function); }
public SpecificationStep getSpecificationStep(final SpecificationStepImplementation stepImplementation) { final TestSpecification tslModel = stepImplementation.getTest().getSpecification(); if ((tslModel != null)) { final Function1<SpecificationStep, Boolean> _function = (SpecificationStep it) -> { return Boolean.valueOf(this.matches(it, stepImplementation)); }; return IterableExtensions.<SpecificationStep>findFirst(tslModel.getSteps(), _function); } return null; }
protected IEObjectDescription getDescription(final URI objectURI) { final IResourceDescription resourceDescription = this.getIndexData().getResourceDescription(objectURI.trimFragment()); if ((resourceDescription == null)) { return null; } final Function1<IEObjectDescription, Boolean> _function = (IEObjectDescription it) -> { URI _eObjectURI = it.getEObjectURI(); return Boolean.valueOf(Objects.equal(_eObjectURI, objectURI)); }; return IterableExtensions.<IEObjectDescription>findFirst(resourceDescription.getExportedObjects(), _function); }
@Override public MethodDeclaration findDeclaredMethod(final String name, final TypeReference... parameterTypes) { final Function1<MethodDeclaration, Boolean> _function = (MethodDeclaration method) -> { return Boolean.valueOf((Objects.equal(method.getSimpleName(), name) && Objects.equal(IterableExtensions.<TypeReference>toList(IterableExtensions.map(method.getParameters(), ((Function1<ParameterDeclaration, TypeReference>) (ParameterDeclaration it) -> { return it.getType(); }))), IterableExtensions.<TypeReference>toList(((Iterable<TypeReference>)Conversions.doWrapArray(parameterTypes)))))); }; return IterableExtensions.findFirst(this.getDeclaredMethods(), _function); }
@Override public ConstructorDeclaration findDeclaredConstructor(final TypeReference... parameterTypes) { final Function1<ConstructorDeclaration, Boolean> _function = (ConstructorDeclaration constructor) -> { final Function1<ParameterDeclaration, TypeReference> _function_1 = (ParameterDeclaration it) -> { return it.getType(); }; List<TypeReference> _list = IterableExtensions.<TypeReference>toList(IterableExtensions.map(constructor.getParameters(), _function_1)); List<TypeReference> _list_1 = IterableExtensions.<TypeReference>toList(((Iterable<TypeReference>)Conversions.doWrapArray(parameterTypes))); return Boolean.valueOf(Objects.equal(_list, _list_1)); }; return IterableExtensions.findFirst(this.getDeclaredConstructors(), _function); }