Class OpResult

java.lang.Object
codes.grow.packages.skywalking.testing.OpResult

public final class OpResult extends Object
A step result with optional extra views for the expectations count and tree. A handler may return a plain value instead.
  • Method Details

    • of

      public static OpResult of(Object value)
      Wraps a value.
      Parameters:
      value - result value, may be null
      Returns:
      a new result
    • withCount

      public OpResult withCount(int count)
      Returns a copy with an explicit count (e.g. the number of spans of a trace).
      Parameters:
      count - element count
      Returns:
      a new result
    • withTree

      public OpResult withTree(Map<String,List<String>> tree)
      Returns a copy with a parent-name to child-names view (span trees).
      Parameters:
      tree - parent name to child names
      Returns:
      a new result
    • value

      public Object value()
      Returns the wrapped value.
      Returns:
      the value, may be null
    • count

      public OptionalInt count()
      Returns the explicit count.
      Returns:
      the count, or empty
    • tree

      public Optional<Map<String,List<String>>> tree()
      Returns the tree view.
      Returns:
      the tree, or empty