com.holonplatform.core

## Interface Path<T>

- Type Parameters:
    `T` - Type of the element identified by this path
  All Superinterfaces:
    Expression, Serializable
  All Known Subinterfaces:
    Aliasable.AliasablePath<T,C>, BeanProperty<T>, BeanProperty.Builder<T>, DataTarget<T>, Join<T>, Path.FinalPath<T>, Path.PathBuilder<T>, PathExpression<T>, PathProperty<T>, PathProperty.PathPropertyBuilder<T>, RelationalTarget<T>

      public interface Path<T>
      extends Expression, Serializable

  Represents a generic, typed path for a data structure attribute which can be identified by a `String` name.

  If the path belongs to a hierarchical structure, the parent path can be provided using `getParent()`.

  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `Path.Builder<T,B extends Path.Builder<T,B>>` Base path builder
    `static interface` | `Path.FinalPath<T>` Represents a final path, i.e. a path which do not support any parent path.
    `static interface` | `Path.PathBuilder<T>` Path builder.

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.Expression

      `Expression.ExpressionResolverFunction<E extends Expression,R extends Expression>, Expression.InvalidExpressionException`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static char` | `PATH_HIERARCHY_SEPARATOR` Separator character used as separator between path hierarchy elements when composing or parsing a path name.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default String` | `fullName()` Gets the path full name, including any parent path, separated by a dot `.`
    `String` | `getName()` Gets the path name
    `Optional<Path<?>>` | `getParent()` Gets the parent path
    `Class<? extends T>` | `getType()` Gets the type of the element identified by this path
    `default boolean` | `isRootPath()` Checks whether this path is a root path, i.e. it has no parent path.
    `static <T> Path.PathBuilder<T>` | `of(String name, Class<? extends T> type)` Create a default `Path` implementation with given `name` and `type`.
    `default String` | `relativeName()` Gets the relative path name, separated by a dot `.`
    `default Stream<Path<?>>` | `stream()` Returns a `Stream` of path hierarchy, starting form this path and walking through parent paths, if any.

    - ### Methods inherited from interface com.holonplatform.core.Expression

      `validate`

- - ### Field Detail

    - #### PATH_HIERARCHY_SEPARATOR

          static final char PATH_HIERARCHY_SEPARATOR

      Separator character used as separator between path hierarchy elements when composing or parsing a path name.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getName

          String getName()

      Gets the path name
      Returns:
        Path name (should never be null)

    - #### getParent

          Optional<Path<?>> getParent()

      Gets the parent path
      Returns:
        Optional parent path, empty if none

    - #### getType

          Class<? extends T> getType()

      Gets the type of the element identified by this path
      Returns:
        Path type

    - #### isRootPath

          default boolean isRootPath()

      Checks whether this path is a root path, i.e. it has no parent path.
      Returns:
        `true` if it is a root path, `false` otherwise

    - #### stream

          default Stream<Path<?>> stream()

      Returns a `Stream` of path hierarchy, starting form this path and walking through parent paths, if any.
      Returns:
        Path hierarchy stream

    - #### fullName

          default String fullName()

      Gets the path full name, including any parent path, separated by a dot `.` character.
      Returns:
        Path full name

    - #### relativeName

          default String relativeName()

      Gets the relative path name, separated by a dot `.` character, i.e. exclude any `Path.FinalPath` path instance from path name composition.
      Returns:
        Path relative name, en empty String if this Path is a `Path.FinalPath` itself.

    - #### of

          static <T> Path.PathBuilder<T> of(String name,
                                            Class<? extends T> type)

      Create a default `Path` implementation with given `name` and `type`.

      The returned type is a `Path` instance implementing also `Path.Builder` to provide instance configuration methods.

      Type Parameters:
        `T` - Path type
      Parameters:
        `name` - Path name (not null)
        `type` - Path type (not null)
      Returns:
        New PathBuilder path instance

Copyright © 2017 The Holon Platform. All rights reserved.