@Test public void apply_returning_no_name() { final LiteralGroupExpression expr = new LiteralGroupExpression(resolver); when(resolver.apply(ctx)).thenReturn(Optional.empty()); assertEquals(TimeSeriesValueSet.EMPTY, expr.getTSDelta(ctx)); }
@Override public TimeSeriesValueSet getTSDelta(Context ctx) { return name_.apply(ctx) .map(path -> SimpleGroupPath.valueOf(path.getPath())) .map(name -> ctx.getTSData().getTSValue(name)) .orElse(TimeSeriesValueSet.EMPTY); }
LiteralGroupExpression implements GroupExpression { @Override public TimeSeriesValueSet getTSDelta(Context ctx) { return name_.apply(ctx) .map(path -> SimpleGroupPath.valueOf(path.getPath())) .map(name -> ctx.getTSData().getTSValue(name)) .orElse(TimeSeriesValueSet.EMPTY); } }
LiteralGroupExpression implements GroupExpression { @Override public TimeSeriesValueSet getTSDelta(Context ctx) { return name_.apply(ctx) .map(path -> SimpleGroupPath.valueOf(path.getPath())) .map(name -> ctx.getTSData().getTSValue(name)) .orElse(TimeSeriesValueSet.EMPTY); } LiteralGroupExpression(NameResolver name); }
LiteralGroupExpression implements GroupExpression { @Override public TimeSeriesValueSet getTSDelta(Context ctx) { return name_.apply(ctx) .map(path -> SimpleGroupPath.valueOf(path.getPath())) .map(name -> ctx.getTSData().getTSValue(name)) .orElse(TimeSeriesValueSet.EMPTY); } LiteralGroupExpression(NameResolver name); NameResolver getName(); @Override PathMatcher getPathMatcher(); @Override StringBuilder configString(); @Override String toString(); @Override TimeSeriesValueSet getTSDelta(Context ctx); @Override int hashCode(); @Override boolean equals(Object obj); }
LiteralGroupExpression implements GroupExpression { @Override public TimeSeriesValueSet getTSDelta(Context ctx) { return name_.apply(ctx) .map(path -> SimpleGroupPath.valueOf(path.getPath())) .map(name -> ctx.getTSData().getTSValue(name)) .orElse(TimeSeriesValueSet.EMPTY); } LiteralGroupExpression(NameResolver name); NameResolver getName(); @Override PathMatcher getPathMatcher(); @Override StringBuilder configString(); @Override String toString(); @Override TimeSeriesValueSet getTSDelta(Context ctx); @Override int hashCode(); @Override boolean equals(Object obj);  }