Package org.springframework.data.mapping
Interface PersistentPropertyPath<P extends PersistentProperty<P>>
- All Superinterfaces:
Iterable<P>
,Streamable<P>
,Supplier<Stream<P>>
Abstraction of a path of
PersistentProperty
s.- Author:
- Oliver Gierke
-
Method Summary
Modifier and TypeMethodDescriptionReturns the first property in thePersistentPropertyPath
.Returns the sub-path of the current one as if it was based on the given base path.Returns the last property in thePersistentPropertyPath
.int
Returns the length of thePersistentPropertyPath
.Returns the parent path of the currentPersistentPropertyPath
, i.e. the path without the leaf property.default P
boolean
isBasePathOf
(PersistentPropertyPath<P> path) Returns whether the givenPersistentPropertyPath
is a base path of the current one.Returns the dot based path notation usingPersistentProperty.getName()
.Returns the dot based path notation using the givenConverter
to translate individualPersistentProperty
s to path segments.Returns aString
path with the given delimiter based on thePersistentProperty.getName()
.Returns aString
path with the given delimiter using the givenConverter
forPersistentProperty
to String conversion.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
toDotPath
Returns the dot based path notation usingPersistentProperty.getName()
.- Returns:
-
toDotPath
Returns the dot based path notation using the givenConverter
to translate individualPersistentProperty
s to path segments.- Parameters:
converter
- must not be null.- Returns:
-
toPath
Returns aString
path with the given delimiter based on thePersistentProperty.getName()
.- Parameters:
delimiter
- must not be null.- Returns:
-
toPath
Returns aString
path with the given delimiter using the givenConverter
forPersistentProperty
to String conversion.- Parameters:
delimiter
- must not be null.converter
- must not be null.- Returns:
-
getLeafProperty
Returns the last property in thePersistentPropertyPath
. So forfoo.bar
it will return thePersistentProperty
forbar
. For a simplefoo
it returnsPersistentProperty
forfoo
.- Returns:
-
getRequiredLeafProperty
-
getBaseProperty
Returns the first property in thePersistentPropertyPath
. So forfoo.bar
it will return thePersistentProperty
forfoo
. For a simplefoo
it returnsPersistentProperty
forfoo
.- Returns:
-
isBasePathOf
Returns whether the givenPersistentPropertyPath
is a base path of the current one. This means that the currentPersistentPropertyPath
is basically an extension of the given one.- Parameters:
path
- must not be null.- Returns:
-
getExtensionForBaseOf
Returns the sub-path of the current one as if it was based on the given base path. So for a current pathfoo.bar
and a given basefoo
it would returnbar
. If the given path is not a base of the the current one the currentPersistentPropertyPath
will be returned as is.- Parameters:
base
- must not be null.- Returns:
-
getParentPath
PersistentPropertyPath<P> getParentPath()Returns the parent path of the currentPersistentPropertyPath
, 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 thePersistentPropertyPath
.- Returns:
-