/** * Determines if the given iterable is <code>null</code> or contains no elements. * * @param iterable * the to-be-queried iterable. May be <code>null</code>. * @return {@code true} if the iterable is <code>null</code> or contains no elements */ public static boolean isNullOrEmpty(Iterable<?> iterable) { return iterable == null || isEmpty(iterable); }
/** * Determines if the given iterable is <code>null</code> or contains no elements. * * @param iterable * the to-be-queried iterable. May be <code>null</code>. * @return {@code true} if the iterable is <code>null</code> or contains no elements */ public static boolean isNullOrEmpty(Iterable<?> iterable) { return iterable == null || isEmpty(iterable); }
protected boolean shouldGenerateArtefacts(final Iterable<AbstractRule> exportedRules) { return (this.generate && (!IterableExtensions.isEmpty(exportedRules))); }
public <T extends Object> Iterable<T> andAlso(final Iterable<T> list, final Iterable<T> another) { if (((list == null) || IterableExtensions.isEmpty(list))) { return this.<T>safe(another); } if (((another == null) || IterableExtensions.isEmpty(another))) { return list; } final LinkedList<T> result = new LinkedList<T>(); Iterables.<T>addAll(result, list); Iterables.<T>addAll(result, another); return result; }
public Iterable<String> mapParametersToTypeName(final Iterable<FArgument> parameters) { final ArrayList<String> result = new ArrayList<String>(); boolean _isEmpty = IterableExtensions.isEmpty(parameters); if (_isEmpty) { result.add("void"); } else { for (final FArgument parameter : parameters) { result.add(this.getTypeName(parameter)); } } return result; }
public Boolean apply(final Attribute e) { EList<AttributeProperty> _attributProperties = e.getAttributProperties(); Iterable<RequiredFlag> _filter = Iterables.<RequiredFlag>filter(_attributProperties, RequiredFlag.class); boolean _isEmpty = IterableExtensions.isEmpty(_filter); boolean _not = (!_isEmpty); return Boolean.valueOf(_not); } };
public void visitAll(final Iterable<? extends ASTNode> iterable) { boolean _isEmpty = IterableExtensions.isEmpty(iterable); if (_isEmpty) { return; } else { this.visitAll(iterable, null); } }
public Boolean isAssignedInBody(final Block scope, final VariableDeclarationFragment fieldDeclFragment) { boolean _isEmpty = IterableExtensions.isEmpty(this.findAssignmentsInBlock(scope, fieldDeclFragment)); return Boolean.valueOf((!_isEmpty)); }
public Boolean apply(final Attribute e) { EList<AttributeProperty> _attributProperties = e.getAttributProperties(); Iterable<AttributeValidationProperty> _filter = Iterables.<AttributeValidationProperty>filter(_attributProperties, AttributeValidationProperty.class); final Function1<AttributeValidationProperty,EList<Constraint>> _function = new Function1<AttributeValidationProperty,EList<Constraint>>() { public EList<Constraint> apply(final AttributeValidationProperty a) { EList<Constraint> _constraints = a.getConstraints(); return _constraints; } }; Iterable<EList<Constraint>> _map = IterableExtensions.<AttributeValidationProperty, EList<Constraint>>map(_filter, _function); boolean _isEmpty = IterableExtensions.isEmpty(_map); boolean _not = (!_isEmpty); return Boolean.valueOf(_not); } };
public Boolean apply(final Attribute e) { EList<AttributeProperty> _attributProperties = e.getAttributProperties(); Iterable<AttributeValidationProperty> _filter = Iterables.<AttributeValidationProperty>filter(_attributProperties, AttributeValidationProperty.class); final Function1<AttributeValidationProperty,EList<Constraint>> _function = new Function1<AttributeValidationProperty,EList<Constraint>>() { public EList<Constraint> apply(final AttributeValidationProperty a) { EList<Constraint> _constraints = a.getConstraints(); return _constraints; } }; Iterable<EList<Constraint>> _map = IterableExtensions.<AttributeValidationProperty, EList<Constraint>>map(_filter, _function); boolean _isEmpty = IterableExtensions.isEmpty(_map); boolean _not = (!_isEmpty); return Boolean.valueOf(_not); } };
public Boolean apply(final Attribute e) { EList<AttributeProperty> _attributProperties = e.getAttributProperties(); Iterable<AttributeValidationProperty> _filter = Iterables.<AttributeValidationProperty>filter(_attributProperties, AttributeValidationProperty.class); final Function1<AttributeValidationProperty,EList<Constraint>> _function = new Function1<AttributeValidationProperty,EList<Constraint>>() { public EList<Constraint> apply(final AttributeValidationProperty a) { EList<Constraint> _constraints = a.getConstraints(); return _constraints; } }; Iterable<EList<Constraint>> _map = IterableExtensions.<AttributeValidationProperty, EList<Constraint>>map(_filter, _function); boolean _isEmpty = IterableExtensions.isEmpty(_map); boolean _not = (!_isEmpty); return Boolean.valueOf(_not); } };
public boolean hasMethodWithoutReturnValue(final FInterface interfaceType) { EList<FMethod> _methods = interfaceType.getMethods(); for (final FMethod method : _methods) { boolean _isEmpty = IterableExtensions.isEmpty(this._methodUtil.getOutputParameters(method)); if (_isEmpty) { return true; } } return false; }
public boolean hasMethodWithReturnValue(final FInterface interfaceType) { EList<FMethod> _methods = interfaceType.getMethods(); for (final FMethod method : _methods) { boolean _isEmpty = IterableExtensions.isEmpty(this._methodUtil.getOutputParameters(method)); boolean _not = (!_isEmpty); if (_not) { return true; } } return false; }
public boolean isPackageVisibility(final Iterable<Modifier> modifier) { final Function1<Modifier, Boolean> _function = (Modifier it) -> { return Boolean.valueOf(((it.isPublic() || it.isPrivate()) || it.isProtected())); }; return IterableExtensions.isEmpty(IterableExtensions.<Modifier>filter(modifier, _function)); }
public void appendTypeParameters(final Iterable<TypeParameter> iterable) { boolean _isEmpty = IterableExtensions.isEmpty(iterable); if (_isEmpty) { return; } this.appendToBuffer("<"); this.visitAllSeparatedByComma(iterable); this.appendToBuffer(">"); }
public boolean needsFinalFieldConstructor(final MutableClassDeclaration it) { return ((!this.hasFinalFieldsConstructor(it)) && IterableExtensions.isEmpty(((ClassDeclaration) this.context.getPrimarySourceElement(it)).getDeclaredConstructors())); }
/** * Returns the errors that are produced for elements that are directly contained * in this feature (e.g. unresolved type proxies) or that are associated with * the expression that may be logically contained in the given feature. */ private Iterable<Issue> getDirectErrorsOrLogicallyContainedErrors(final JvmFeature feature) { Iterable<Issue> errors = this._errorSafeExtensions.getErrors(feature); boolean _isEmpty = IterableExtensions.isEmpty(errors); if (_isEmpty) { final XExpression expression = this._iLogicalContainerProvider.getAssociatedExpression(feature); if ((expression != null)) { errors = this._errorSafeExtensions.getErrors(expression); } } return errors; }
@Override public void delete(final Path path) { final URI uri = this.getURI(path); if ((uri == null)) { return; } if (((this.isFolder(uri)).booleanValue() && (!IterableExtensions.isEmpty(this.getChildren(uri, path))))) { return; } try { this.getURIConverter().delete(uri, null); } catch (final Throwable _t) { if (_t instanceof IOException) { final IOException exc = (IOException)_t; String _message = exc.getMessage(); throw new IllegalArgumentException(_message, exc); } else { throw Exceptions.sneakyThrow(_t); } } }
private boolean isRequiredFlagConditional(final Attribute e) { EList<AttributeProperty> _attributProperties = e.getAttributProperties(); final Iterable<RequiredFlag> attProperties = Iterables.<RequiredFlag>filter(_attributProperties, RequiredFlag.class); boolean _and = false; boolean _isEmpty = IterableExtensions.isEmpty(attProperties); boolean _not = (!_isEmpty); if (!_not) { _and = false; } else { RequiredFlag _head = IterableExtensions.<RequiredFlag>head(attProperties); EqualityExpr _expression = _head.getExpression(); String _compile = this._expressionCompiler.compile(_expression); boolean _isCompiledConditionBoolConstant = ValidatorGenerator.isCompiledConditionBoolConstant(_compile); boolean _not_1 = (!_isCompiledConditionBoolConstant); _and = (_not && _not_1); } return _and; }
public boolean canConvertToRichText(final InfixExpression node) { final FieldDeclaration parentFieldDecl = this.<FieldDeclaration>findParentOfType(node, FieldDeclaration.class); if ((parentFieldDecl != null)) { final TypeDeclaration typeDeclr = this.<TypeDeclaration>findParentOfType(parentFieldDecl, TypeDeclaration.class); if ((typeDeclr.isInterface() || (this.isFinal(parentFieldDecl.modifiers()) && this.isStatic(parentFieldDecl.modifiers())))) { return false; } } final SingleMemberAnnotation parentSingleMemberAnnotation = this.<SingleMemberAnnotation>findParentOfType(node, SingleMemberAnnotation.class); if ((parentSingleMemberAnnotation != null)) { return false; } final Iterable<StringLiteral> nodes = this.collectCompatibleNodes(node); return ((!IterableExtensions.isEmpty(nodes)) && IterableExtensions.<StringLiteral>forall(nodes, ((Function1<StringLiteral, Boolean>) (StringLiteral it) -> { return Boolean.valueOf(this.canTranslate(it)); }))); }