Class ValuePathEvaluator


  • public final class ValuePathEvaluator
    extends java.lang.Object
    Evaluates a path describing a value to be shown in a trade report.

    For example, if the expression is 'Product.index.name' and the results contain FraTrade instances the following calls will be made for each trade in the results:

    • FraTrade.getProduct() returning a Fra
    • Fra.getIndex() returning an IborIndex
    • IborIndex.getName() returning the index name
    The result of evaluating the expression is the index name.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<Result<?>> evaluate​(java.lang.String valuePath, ReportCalculationResults results)
      Evaluates a value path against a set of results, returning the resolved result for each trade.
      static java.util.Optional<Measure> measure​(java.lang.String valuePath)
      Gets the measure encoded in a value path, if present.
      static java.util.Set<java.lang.String> tokens​(java.lang.Object object)
      Gets the supported tokens on the given object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • measure

        public static java.util.Optional<Measure> measure​(java.lang.String valuePath)
        Gets the measure encoded in a value path, if present.
        Parameters:
        valuePath - the value path
        Returns:
        the measure, if present
      • evaluate

        public static java.util.List<Result<?>> evaluate​(java.lang.String valuePath,
                                                         ReportCalculationResults results)
        Evaluates a value path against a set of results, returning the resolved result for each trade.
        Parameters:
        valuePath - the value path
        results - the calculation results
        Returns:
        the list of resolved results for each trade
      • tokens

        public static java.util.Set<java.lang.String> tokens​(java.lang.Object object)
        Gets the supported tokens on the given object.
        Parameters:
        object - the object for which to return the valid tokens
        Returns:
        the tokens