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 PersistentPropertys.
Author:
Oliver Gierke, Johannes Englmeier
  • Method Details

    • toDotPath

      @Nullable String toDotPath()
      Returns the dot based path notation using PersistentProperty.getName().
      Returns:
    • toDotPath

      @Nullable String toDotPath(org.springframework.core.convert.converter.Converter<? super P,String> converter)
      Returns the dot based path notation using the given Converter to translate individual PersistentPropertys 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, org.springframework.core.convert.converter.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: