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, Johannes Englmeier
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic PropertyPathExtracts thePropertyPathchain from the given sourceStringand type.static PropertyPathfrom(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()inthashCode()booleanhasNext()Returns whether there is a nestedPropertyPath.booleanReturns whether thePropertyPathis actually a collection.iterator()Returns thePropertyPathfor the path nested under the current property.next()Returns the next nestedPropertyPath.Returns thePropertyPathin dot notation.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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 anyIterableor the value type of aMapif the property is one.- Returns:
-
getTypeInformation
-
next
Returns the next nestedPropertyPath.- Returns:
- the next nested
PropertyPathor null if no nestedPropertyPathavailable. - 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 thePropertyPathin dot notation.- Returns:
-
isCollection
public boolean isCollection()Returns whether thePropertyPathis actually a collection.- Returns:
-
nested
Returns thePropertyPathfor the path nested under the current property.- Parameters:
path- must not be null or empty.- Returns:
- will never be null.
-
iterator
- Specified by:
iteratorin interfaceIterable<PropertyPath>
-
equals
-
hashCode
public int hashCode() -
from
Extracts thePropertyPathchain from the given sourceStringand type.- Parameters:
source-type-- Returns:
-
from
Extracts thePropertyPathchain from the given sourceStringandTypeInformation.
UsesSPLITTERby default andSPLITTER_FOR_QUOTEDforquotedliterals.- Parameters:
source- must not be null.type-- Returns:
-
toString
-