Interface TestPState

All Superinterfaces:
AutoCloseable, Closeable

public interface TestPState extends Closeable
Helper utility compatible with Block.localSelect(java.lang.String, com.rpl.rama.Path) and Block.localTransform(java.lang.String, com.rpl.rama.Path). This can be used in unit tests of snippets of dataflow code, or it can be used to explore PStates and paths. This object should be closed when no longer needed to clean up its resources.
  • Method Details

    • create

      static TestPState create(PState.Schema schema)
      Creates a TestPState with the given schema.
    • create

      static TestPState create(Class schema)
      Creates a TestPState with the given schema.
    • select

      <T> List<T> select(Path path)
      Queries PState with Path.
      Type Parameters:
      T - Type of navigated values
      Parameters:
      path - Query path
      Returns:
      List of navigated values
      See Also:
    • selectOne

      <T> T selectOne(Path path)
      Queries PState with Path that must navigate to exactly one value.
      Type Parameters:
      T - Type of navigated value
      Parameters:
      path - Query path
      Returns:
      Navigated value
      See Also:
    • transform

      void transform(Path path)
      Transforms PState with Path.
      Parameters:
      path - transform path
      See Also: