Package org.springframework.data.mapping
Class PropertyPath
java.lang.Object
org.springframework.data.mapping.PropertyPath
- All Implemented Interfaces:
Iterable<PropertyPath>
,Supplier<Stream<PropertyPath>>
,Streamable<PropertyPath>
Abstraction of a
PropertyPath
of a domain class.- Author:
- Oliver Gierke, Christoph Strobl, Mark Paluch, Mariusz MÄ…czkowski
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static PropertyPath
Extracts thePropertyPath
chain from the given sourceString
and type.static PropertyPath
from
(String source, TypeInformation<?> type) Returns the leaf property of thePropertyPath
.Class<?>
Returns the type of the leaf property of the currentPropertyPath
.Returns the owning type of thePropertyPath
.Returns the name of thePropertyPath
.Class<?>
getType()
int
hashCode()
boolean
hasNext()
Returns whether there is a nestedPropertyPath
.boolean
Returns whether thePropertyPath
is actually a collection.iterator()
Returns thePropertyPath
for the path nested under the current property.next()
Returns the next nestedPropertyPath
.Returns thePropertyPath
in dot notation.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getOwningType
Returns the owning type of thePropertyPath
.- Returns:
- the owningType will never be null.
-
getSegment
Returns the name of thePropertyPath
.- Returns:
- the name will never be null.
-
getLeafProperty
Returns the leaf property of thePropertyPath
.- Returns:
- will never be null.
-
getLeafType
Returns the type of the leaf property of the currentPropertyPath
.- Returns:
- will never be null.
-
getType
Returns the type of the property will return the plain resolved type for simple properties, the component type for anyIterable
or the value type of aMap
if the property is one.- Returns:
-
getTypeInformation
-
next
Returns the next nestedPropertyPath
.- Returns:
- the next nested
PropertyPath
or null if no nestedPropertyPath
available. - See Also:
-
hasNext
public boolean hasNext()Returns whether there is a nestedPropertyPath
. If this returns true you can expectnext()
to return a non- null value.- Returns:
-
toDotPath
Returns thePropertyPath
in dot notation.- Returns:
-
isCollection
public boolean isCollection()Returns whether thePropertyPath
is actually a collection.- Returns:
-
nested
Returns thePropertyPath
for the path nested under the current property.- Parameters:
path
- must not be null or empty.- Returns:
- will never be null.
-
iterator
- Specified by:
iterator
in interfaceIterable<PropertyPath>
-
equals
-
hashCode
public int hashCode() -
from
Extracts thePropertyPath
chain from the given sourceString
and type.- Parameters:
source
-type
-- Returns:
-
from
Extracts thePropertyPath
chain from the given sourceString
andTypeInformation
.
UsesSPLITTER
by default andSPLITTER_FOR_QUOTED
forquoted
literals.- Parameters:
source
- must not be null.type
-- Returns:
-
toString
-