org.springframework.data.mapping

## Interface PersistentPropertyPath<P extends PersistentProperty<P>>

All Superinterfaces:
  Iterable<P>, Streamable<P>, Supplier<Stream<P>>

    public interface PersistentPropertyPath<P extends PersistentProperty<P>>
    extends Streamable<P>

Abstraction of a path of `PersistentProperty`s.

Author:
  Oliver Gierke

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`P` `getBaseProperty()` Returns the first property in the `PersistentPropertyPath`.
`PersistentPropertyPath<P>` `getExtensionForBaseOf(PersistentPropertyPath<P> base)` Returns the sub-path of the current one as if it was based on the given base path.
`P` `getLeafProperty()` Returns the last property in the `PersistentPropertyPath`.
`int` `getLength()` Returns the length of the `PersistentPropertyPath`.
`PersistentPropertyPath<P>` `getParentPath()` Returns the parent path of the current `PersistentPropertyPath`, i.e. the path without the leaf property.
`default P` `getRequiredLeafProperty()`
`boolean` `isBasePathOf(PersistentPropertyPath<P> path)` Returns whether the given `PersistentPropertyPath` is a base path of the current one.
`String` `toDotPath()` Returns the dot based path notation using `PersistentProperty.getName()`.
`String` `toDotPath(Converter<? super P,String> converter)` Returns the dot based path notation using the given `Converter` to translate individual `PersistentProperty`s to path segments.
`String` `toPath(String delimiter)` Returns a `String` path with the given delimiter based on the `PersistentProperty.getName()`.
`String` `toPath(String delimiter, Converter<? super P,String> converter)` Returns a `String` path with the given delimiter using the given `Converter` for `PersistentProperty` to String conversion.

### 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, iterator, spliterator`

### Method Detail

#### toDotPath

    @Nullable
    String toDotPath()

Returns the dot based path notation using `PersistentProperty.getName()`.

Returns:

#### toDotPath

    @Nullable
    String toDotPath(Converter<? super P,String> converter)

Returns the dot based path notation using the given `Converter` to translate individual `PersistentProperty`s to path segments.

Parameters:
  `converter` - must not be null.
Returns:

#### toPath

    @Nullable
    String toPath(String delimiter)

Returns a `String` path with the given delimiter based on the `PersistentProperty.getName()`.

Parameters:
  `delimiter` - must not be null.
Returns:

#### toPath

    @Nullable
    String toPath(String delimiter,
                            Converter<? super P,String> converter)

Returns a `String` path with the given delimiter using the given `Converter` for `PersistentProperty` to String conversion.

Parameters:
  `delimiter` - must not be null.
  `converter` - must not be null.
Returns:

#### getLeafProperty

    @Nullable
    P getLeafProperty()

Returns the last property in the `PersistentPropertyPath`. So for `foo.bar` it will return the `PersistentProperty` for `bar`. For a simple `foo` it returns `PersistentProperty` for `foo`.

Returns:

#### getRequiredLeafProperty

    default P getRequiredLeafProperty()

#### getBaseProperty

    @Nullable
    P getBaseProperty()

Returns the first property in the `PersistentPropertyPath`. So for `foo.bar` it will return the `PersistentProperty` for `foo`. For a simple `foo` it returns `PersistentProperty` for `foo`.

Returns:

#### isBasePathOf

    boolean isBasePathOf(PersistentPropertyPath<P> path)

Returns whether the given `PersistentPropertyPath` is a base path of the current one. This means that the current `PersistentPropertyPath` is basically an extension of the given one.

Parameters:
  `path` - must not be null.
Returns:

#### getExtensionForBaseOf

    PersistentPropertyPath<P> getExtensionForBaseOf(PersistentPropertyPath<P> base)

Returns the sub-path of the current one as if it was based on the given base path. So for a current path `foo.bar` and a given base `foo` it would return `bar`. If the given path is not a base of the the current one the current `PersistentPropertyPath` will be returned as is.

Parameters:
  `base` - must not be null.
Returns:

#### getParentPath

    PersistentPropertyPath<P> getParentPath()

Returns the parent path of the current `PersistentPropertyPath`, i.e. the path without the leaf property. This happens up to the base property. So for a direct property reference calling this method will result in returning the property.

Returns:

#### getLength

    int getLength()

Returns the length of the `PersistentPropertyPath`.

Returns: