com.holonplatform.core.internal

## Class DefaultPath<T>

- java.lang.Object
- - com.holonplatform.core.internal.DefaultPath<T>

- Type Parameters:
    `T` - Path type
  All Implemented Interfaces:
    DataMappable, DataMappable.Builder<Path.PathBuilder<T>>, Expression, Path<T>, Path.Builder<T,Path.PathBuilder<T>>, Path.PathBuilder<T>, TypedExpression<T>, Serializable
  Direct Known Subclasses:
    DefaultFinalPath

      public class DefaultPath<T>
      extends Object
      implements Path.PathBuilder<T>

  Default `Path` implementation.
  Since:
    5.0.0
  See Also:
    Serialized Form

- - ### Nested Class Summary

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

      `Path.Builder<T,B extends Path.Builder<T,B>>, Path.FinalPath<T>, Path.PathBuilder<T>`

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

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

  - ### Field Summary

    - ### Fields inherited from interface com.holonplatform.core.Path

      `PATH_HIERARCHY_SEPARATOR`

    - ### Fields inherited from interface com.holonplatform.core.DataMappable

      `DEFAULT_CONFIG_PROPERTY_PREFIX, PATH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultPath(String name, Class<? extends T> type)` Construct a new DefaultPath

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Path.PathBuilder<T>` | `dataPath(String dataPath)` Sets the data model path name to which this object is bound.
    `Optional<String>` | `getDataPath()` Get the data model path name to which this object is bound, if available.
    `String` | `getName()` Gets the path name
    `Optional<Path<?>>` | `getParent()` Gets the parent path
    `Class<? extends T>` | `getType()` Get the expression type.
    `Path.PathBuilder<T>` | `parent(Path<?> parent)` Sets the parent path
    `String` | `toString()`
    `void` | `validate()` Validate this expression.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

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

      `fullName, fullName, isRootPath, of, relativeName, relativeName, stream`

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

      `getTemporalType, isCollectionExpression, isConverterExpression`

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

      `isDataMappable`

- - ### Constructor Detail

    - #### DefaultPath

          public DefaultPath(String name,
                             Class<? extends T> type)

      Construct a new DefaultPath
      Parameters:
        `name` - Path name (not null)
        `type` - Path type (not null)

  - ### Method Detail

    - #### getName

          public String getName()

      Description copied from interface: `Path`
      Gets the path name
      Specified by:
        `getName` in interface `Path<T>`
      Returns:
        Path name (should never be null)

    - #### getType

          public Class<? extends T> getType()

      Description copied from interface: `TypedExpression`
      Get the expression type.
      Specified by:
        `getType` in interface `TypedExpression<T>`
      Returns:
        Expression type

    - #### getParent

          public Optional<Path<?>> getParent()

      Description copied from interface: `Path`
      Gets the parent path
      Specified by:
        `getParent` in interface `Path<T>`
      Returns:
        Optional parent path, empty if none

    - #### parent

          public Path.PathBuilder<T> parent(Path<?> parent)

      Description copied from interface: `Path.Builder`
      Sets the parent path
      Specified by:
        `parent` in interface `Path.Builder<T,Path.PathBuilder<T>>`
      Parameters:
        `parent` - The parent path to set
      Returns:
        this

    - #### dataPath

          public Path.PathBuilder<T> dataPath(String dataPath)

      Description copied from interface: `DataMappable.Builder`
      Sets the data model path name to which this object is bound.
      Specified by:
        `dataPath` in interface `DataMappable.Builder<Path.PathBuilder<T>>`
      Parameters:
        `dataPath` - The data path to set
      Returns:
        this

    - #### getDataPath

          public Optional<String> getDataPath()

      Description copied from interface: `DataMappable`
      Get the data model path name to which this object is bound, if available.
      Specified by:
        `getDataPath` in interface `DataMappable`
      Returns:
        Optional data model path name

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### validate

          public void validate()
                        throws Expression.InvalidExpressionException

      Description copied from interface: `Expression`
      Validate this expression.
      Specified by:
        `validate` in interface `Expression`
      Throws:
        `Expression.InvalidExpressionException` - If the expression is not valid

Copyright © 2019 The Holon Platform. All rights reserved.