org.springframework.data.mapping

## Class PropertyPath

- java.lang.Object
- - org.springframework.data.mapping.PropertyPath

All Implemented Interfaces:
  Iterable<PropertyPath>, Supplier<Stream<PropertyPath>>, Streamable<PropertyPath>

    public class PropertyPath
    extends Object
    implements Streamable<PropertyPath>

Abstraction of a `PropertyPath` of a domain class.

Author:
  Oliver Gierke, Christoph Strobl, Mark Paluch, Mariusz Mączkowski

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `equals(Object o)`
`static PropertyPath` `from(String source, Class<?> type)` Extracts the `PropertyPath` chain from the given source `String` and type.
`static PropertyPath` `from(String source, TypeInformation<?> type)` Extracts the `PropertyPath` chain from the given source `String` and `TypeInformation`.
`PropertyPath` `getLeafProperty()` Returns the leaf property of the `PropertyPath`.
`Class<?>` `getLeafType()` Returns the type of the leaf property of the current `PropertyPath`.
`TypeInformation<?>` `getOwningType()` Returns the owning type of the `PropertyPath`.
`String` `getSegment()` Returns the name of the `PropertyPath`.
`Class<?>` `getType()` Returns the type of the property will return the plain resolved type for simple properties, the component type for any `Iterable` or the value type of a `Map` if the property is one.
`TypeInformation<?>` `getTypeInformation()`
`int` `hashCode()`
`boolean` `hasNext()` Returns whether there is a nested `PropertyPath`.
`boolean` `isCollection()` Returns whether the `PropertyPath` is actually a collection.
`Iterator<PropertyPath>` `iterator()`
`PropertyPath` `nested(String path)` Returns the `PropertyPath` for the path nested under the current property.
`PropertyPath` `next()` Returns the next nested `PropertyPath`.
`String` `toDotPath()` Returns the `PropertyPath` in dot notation.
`String` `toString()`

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

`clone, finalize, getClass, notify, notifyAll, 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

#### getOwningType

    public TypeInformation<?> getOwningType()

Returns the owning type of the `PropertyPath`.

Returns:
  the owningType will never be null.

#### getSegment

    public String getSegment()

Returns the name of the `PropertyPath`.

Returns:
  the name will never be null.

#### getLeafProperty

    public PropertyPath getLeafProperty()

Returns the leaf property of the `PropertyPath`.

Returns:
  will never be null.

#### getLeafType

    public Class<?> getLeafType()

Returns the type of the leaf property of the current `PropertyPath`.

Returns:
  will never be null.

#### getType

    public Class<?> getType()

Returns the type of the property will return the plain resolved type for simple properties, the component type for any `Iterable` or the value type of a `Map` if the property is one.

Returns:

#### getTypeInformation

    public TypeInformation<?> getTypeInformation()

#### next

    @Nullable
    public PropertyPath next()

Returns the next nested `PropertyPath`.

Returns:
  the next nested `PropertyPath` or null if no nested `PropertyPath` available.
See Also:
  `hasNext()`

#### hasNext

    public boolean hasNext()

Returns whether there is a nested `PropertyPath`. If this returns true you can expect `next()` to return a non- null value.

Returns:

#### toDotPath

    public String toDotPath()

Returns the `PropertyPath` in dot notation.

Returns:

#### isCollection

    public boolean isCollection()

Returns whether the `PropertyPath` is actually a collection.

Returns:

#### nested

    public PropertyPath nested(String path)

Returns the `PropertyPath` for the path nested under the current property.

Parameters:
  `path` - must not be null or empty.
Returns:
  will never be null.

#### iterator

    public Iterator<PropertyPath> iterator()

Specified by:
  `iterator` in interface `Iterable<PropertyPath>`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### from

    public static PropertyPath from(String source,
                                    Class<?> type)

Extracts the `PropertyPath` chain from the given source `String` and type.

Parameters:
  `source` -
  `type` -
Returns:

#### from

    public static PropertyPath from(String source,
                                    TypeInformation<?> type)

Extracts the `PropertyPath` chain from the given source `String` and `TypeInformation`.
Uses `SPLITTER` by default and `SPLITTER_FOR_QUOTED` for `quoted` literals.

Parameters:
  `source` - must not be null.
  `type` -
Returns:

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`