org.springframework.data.spel

## Class ExpressionDependencies

- java.lang.Object
- - org.springframework.data.spel.ExpressionDependencies

All Implemented Interfaces:
  Iterable<ExpressionDependencies.ExpressionDependency>, Supplier<Stream<ExpressionDependencies.ExpressionDependency>>, Streamable<ExpressionDependencies.ExpressionDependency>

    public class ExpressionDependencies
    extends Object
    implements Streamable<ExpressionDependencies.ExpressionDependency>

Value object capturing dependencies to a method or property/field that is referenced from a SpEL expression.

Since:
  2.4
Author:
  Mark Paluch, Christoph Strobl

### Nested Class Summary

Nested Classes
`static class` `ExpressionDependencies.ExpressionDependency` Value object to describe a dependency to a method or property/field that is referenced from a SpEL expression.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static ExpressionDependencies` `discover(Expression expression)` Discover all expression dependencies that are referenced in the `expression root`.
`static ExpressionDependencies` `discover(SpelNode root, boolean topLevelOnly)` Discover all expression dependencies that are referenced in the `expression root`.
`boolean` `equals(Object o)`
`int` `hashCode()`
`Iterator<ExpressionDependencies.ExpressionDependency>` `iterator()`
`static ExpressionDependencies` `merged(Iterable<ExpressionDependencies> dependencies)` Return an `ExpressionDependencies` object representing the merged collection of `dependencies` withing the given `ExpressionDependencies` collection.
`ExpressionDependencies` `mergeWith(ExpressionDependencies other)` Create new `ExpressionDependencies` that contains all dependencies from this object and `other`.
`static ExpressionDependencies` `none()` Return an empty `ExpressionDependencies` object.
`static ExpressionDependencies` `of(Collection<ExpressionDependencies.ExpressionDependency> dependencies)` Return an `ExpressionDependencies` object representing the given `Collection` of `dependencies`.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.springframework.data.util.Streamable

`and, and, and, and, empty, filter, flatMap, get, isEmpty, map, of, of, of, stream, toList, toSet, toStreamable, toStreamable`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Method Detail

#### none

    public static ExpressionDependencies none()

Return an empty `ExpressionDependencies` object.

Returns:
  empty dependencies.

#### of

    public static ExpressionDependencies of(Collection<ExpressionDependencies.ExpressionDependency> dependencies)

Return an `ExpressionDependencies` object representing the given `Collection` of `dependencies`.

Returns:
  `ExpressionDependencies` holding the given `dependencies` or `none` if the collection is `empty`.

#### merged

    public static ExpressionDependencies merged(Iterable<ExpressionDependencies> dependencies)

Return an `ExpressionDependencies` object representing the merged collection of `dependencies` withing the given `ExpressionDependencies` collection.

Returns:
  `ExpressionDependencies` holding a set of merged `dependencies` or `none` if the given `Iterable` is `empty`.

#### discover

    public static ExpressionDependencies discover(Expression expression)

Discover all expression dependencies that are referenced in the `expression root`.

Parameters:
  `expression` - the SpEL expression to inspect.
Returns:
  a set of `ExpressionDependencies`.

#### discover

    public static ExpressionDependencies discover(SpelNode root,
                                                  boolean topLevelOnly)

Discover all expression dependencies that are referenced in the `expression root`.

Parameters:
  `root` - the SpEL expression to inspect.
  `topLevelOnly` - whether to include top-level dependencies only. Top-level dependencies are dependencies that indicate the start of a compound expression and required to resolve the next expression item.
Returns:
  a set of `ExpressionDependencies`.

#### mergeWith

    public ExpressionDependencies mergeWith(ExpressionDependencies other)

Create new `ExpressionDependencies` that contains all dependencies from this object and `other`. The merged dependencies are guaranteed to not contain duplicates.

Parameters:
  `other` - the other `ExpressionDependencies` object.
Returns:
  new merged `ExpressionDependencies` object.

#### iterator

    public Iterator<ExpressionDependencies.ExpressionDependency> iterator()

Specified by:
  `iterator` in interface `Iterable<ExpressionDependencies.ExpressionDependency>`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`