public String getSimpleName() { return IterableExtensions.<String>last(this.simpleNames); }
/** * This method returns the pattern name. * If the pattern name contains the package (any dot), * then removes all segment except the last one. */ public String realPatternName(final String fqn) { Splitter _on = Splitter.on("."); Iterable<String> _split = _on.split(fqn); return IterableExtensions.<String>last(_split); }
/** * This method returns the pattern name. * If the pattern name contains the package (any dot), * then removes all segment except the last one. */ public String realPatternName(final String fqn) { return IterableExtensions.<String>last(Splitter.on(".").split(fqn)); }
public Boolean apply(final Attribute e) { String _name = e.getName(); EList<String> _segments = ((PropertyValue) expression).getSegments(); String _last = IterableExtensions.<String>last(_segments); boolean _equals = _name.equals(_last); return Boolean.valueOf(_equals); } };
/** * A potentially contained trailing line delimiter is ignored. */ @Override protected List<String> getSignificantContent() { final List<String> result = super.getSignificantContent(); if (((result.size() >= 1) && Objects.equal(this.getLineDelimiter(), IterableExtensions.<String>last(result)))) { int _size = result.size(); int _minus = (_size - 1); return result.subList(0, _minus); } return result; }
public Boolean apply(final Attribute e) { String _name = e.getName(); EList<String> _segments = ((PropertyValue) expression).getSegments(); String _last = IterableExtensions.<String>last(_segments); boolean _equals = _name.equals(_last); return Boolean.valueOf(_equals); } };
public BodyParameter getBodyParameter(final Operation op) { List<Parameter> _parameters = op.getParameters(); Iterable<Parameter> _filter = null; if (_parameters!=null) { final Function1<Parameter, Boolean> _function = (Parameter it) -> { String _in = it.getIn(); return Boolean.valueOf(Objects.equal(_in, "body")); }; _filter=IterableExtensions.<Parameter>filter(_parameters, _function); } Parameter _last = IterableExtensions.<Parameter>last(_filter); return ((BodyParameter) _last); }
public Object getElementType(final Object obj) { return IterableExtensions.<Object>last(this.collectItemTypes(this.refHelper.resolve(obj), true)); }
protected void _findImplicitReturns(final XBlockExpression expression, final ImplicitReturnFinder.Acceptor acceptor) { this.findImplicitReturns(IterableExtensions.<XExpression>last(expression.getExpressions()), acceptor); }
private String _chooseName(final Object obj, final String offeredName) { String _xifexpression = null; if (((offeredName != null) && offeredName.startsWith("!"))) { _xifexpression = offeredName.substring(1); } else { String _rzveTypeName = this._attributeHelper.getRzveTypeName(obj); String _name = this._attributeHelper.getName(obj); final Function1<String, Boolean> _function = (String it) -> { return Boolean.valueOf((it != null)); }; _xifexpression = IterableExtensions.<String>last(IterableExtensions.<String>filter(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList(offeredName, _rzveTypeName, _name)), _function)); } return _xifexpression; }
private String getDefaultTypeSpec(final Object obj, final AttrDetails det) { String _type = this._attributeHelper.getType(obj); String _rzveTypeName = this._attributeHelper.getRzveTypeName(obj); final Function1<String, Boolean> _function = (String it) -> { return Boolean.valueOf((it != null)); }; return IterableExtensions.<String>last(IterableExtensions.<String>filter(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList(_type, _rzveTypeName)), _function)); }
public String getSchemaTitle(final Object schema) { String _xblockexpression = null; { final Object resolved = this.refHelper.safeResolve(schema); String _title = this.attributeHelper.getTitle(resolved); String _rzveTypeName = this.attributeHelper.getRzveTypeName(resolved); final Function1<String, Boolean> _function = (String it) -> { return Boolean.valueOf((it != null)); }; _xblockexpression = IterableExtensions.<String>last(IterableExtensions.<String>filter(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList(_title, _rzveTypeName)), _function)); } return _xblockexpression; } }
private boolean isStop(final GrammarAlias.TokenAlias it) { return (((it.getToken() == null) && (it.getParent() instanceof GrammarAlias.GroupAlias)) && Objects.equal(it, IterableExtensions.<GrammarAlias.AbstractElementAlias>last(((GrammarAlias.GroupAlias) it.getParent()).getChildren()))); }
public String getElementTypeName(final Object obj) { String _xblockexpression = null; { final Object elementType = this.getElementType(obj); String _type = null; if (elementType!=null) { _type=this.attributeHelper.getType(elementType); } String _rzveTypeName = this.attributeHelper.getRzveTypeName(elementType); _xblockexpression = IterableExtensions.<String>last(IterableExtensions.<String>filterNull(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList(_type, _rzveTypeName)))); } return _xblockexpression; }
protected void _visit(final JvmGenericType jvmType, final INode originNode, final ImportsAcceptor acceptor) { boolean _isAnonymous = jvmType.isAnonymous(); if (_isAnonymous) { this.visit(IterableExtensions.<JvmTypeReference>last(jvmType.getSuperTypes()).getType(), originNode, acceptor); } else { this._visit(((JvmDeclaredType) jvmType), originNode, acceptor); } }
protected void _format(final XImportSection section, @Extension final IFormattableDocument format) { EList<XImportDeclaration> _importDeclarations = section.getImportDeclarations(); for (final XImportDeclaration imp : _importDeclarations) { { format.<XImportDeclaration>format(imp); XImportDeclaration _last = IterableExtensions.<XImportDeclaration>last(section.getImportDeclarations()); boolean _notEquals = (!Objects.equal(imp, _last)); if (_notEquals) { format.<XImportDeclaration>append(imp, XbaseFormatterPreferenceKeys.blankLinesBetweenImports); } else { format.<XImportDeclaration>append(imp, XbaseFormatterPreferenceKeys.blankLinesAfterImports); } } } }
public void appendWithTrailingSeparator(final T object, final R separator) { final ObjectEntry<T, R> newObject = new ObjectEntry<T, R>(this); newObject.setObject(object); if ((separator != null)) { final SeparatorEntry<T, R> newSeparator = new SeparatorEntry<T, R>(); newSeparator.setSeparator(separator); newObject.next = newSeparator; newSeparator.previous = newObject; } if ((this.first == null)) { this.first = newObject; } else { final SeparatorEntry<T, R> last = IterableExtensions.<SeparatorEntry<T, R>>last(this.separators()); newObject.previous = last; last.next = newObject; } }
@Check public void checkRedundantCase(XSwitchExpression switchExpression) { XCasePart casePart = IterableExtensions.last(switchExpression.getCases()); if (casePart == null || !(casePart.isFallThrough() && casePart.getThen() == null)) { return; } if (switchExpression.getDefault() == null) { error("Redundant case.", casePart, null, IssueCodes.REDUNDANT_CASE); } else { warning("Redundant case.", casePart, null, IssueCodes.REDUNDANT_CASE); } }
public TypeReference getRightType(final TypeReference typeReference) { final Type type = typeReference.getType(); Type _type = this.eitherType.getType(); boolean _tripleEquals = (type == _type); if (_tripleEquals) { return IterableExtensions.<TypeReference>last(typeReference.getActualTypeArguments()); } if ((type instanceof InterfaceDeclaration)) { final Function1<TypeReference, TypeReference> _function = (TypeReference it) -> { return this.getRightType(it); }; return IterableExtensions.<TypeReference>head(IterableExtensions.<TypeReference>filterNull(IterableExtensions.map(((InterfaceDeclaration)type).getExtendedInterfaces(), _function))); } return null; }
public String buildWriteExpression(final VariableReferencePathAccess varRef, final String assignedExpression) { StringConcatenation _builder = new StringConcatenation(); String _variableToVarName = this.variableToVarName(varRef.getVariable()); _builder.append(_variableToVarName); final Function1<AccessPathElement, String> _function = (AccessPathElement it) -> { return this.jsonUtil.jsonPathReadAccessToString(it); }; String _join = IterableExtensions.join(IterableExtensions.<AccessPathElement, String>map(this._collectionUtils.<AccessPathElement>butLast(varRef.getPath()), _function)); _builder.append(_join); String _jsonPathWriteAccessToString = this.jsonUtil.jsonPathWriteAccessToString(IterableExtensions.<AccessPathElement>last(varRef.getPath()), assignedExpression); _builder.append(_jsonPathWriteAccessToString); final String result = _builder.toString(); return result; }