@Test public void extract() { Map<String, Value> results = extractor.extract(context); assertEquals(3, results.size()); assertEquals(1L, (long)results.get("test1").getAsLong()); assertEquals(2L, (long)results.get("test2").getAsLong()); assertEquals(3L, (long)results.get("test3").getAsLong()); results = clone.extract(context); assertEquals(3, results.size()); assertEquals(1L, (long)results.get("test1").getAsLong()); assertEquals(2L, (long)results.get("test2").getAsLong()); assertEquals(3L, (long)results.get("test3").getAsLong()); }
@Override public Map<String, Value> extract(EvaluationContext context) { try { return context.get().getChannels().stream().collect(Collectors.toMap( channel -> channel, channel -> context.get().getValue(channel) )); } catch (Exception e) { logger.warn("could not extract all channel values", e); return Collections.emptyMap(); } }
AllChannelMapExtractor implements MapExtractor { @Override public Map<String, Value> extract(EvaluationContext context) { try { return context.get().getChannels().stream().collect(Collectors.toMap( channel -> channel, channel -> context.get().getValue(channel) )); } catch (Exception e) { logger.warn("could not extract all channel values", e); return Collections.emptyMap(); } } }
AllChannelMapExtractor implements MapExtractor { @Override public Map<String, Value> extract(EvaluationContext context) { try { return context.get().getChannels().stream().collect(Collectors.toMap( channel -> channel, channel -> context.get().getValue(channel) )); } catch (Exception e) { logger.warn("could not extract all channel values", e); return Collections.emptyMap(); } } AllChannelMapExtractor(Set<String> channels); }
AllChannelMapExtractor implements MapExtractor { @Override public Map<String, Value> extract(EvaluationContext context) { try { return context.get().getChannels().stream().collect(Collectors.toMap( channel -> channel, channel -> context.get().getValue(channel) )); } catch (Exception e) { logger.warn("could not extract all channel values", e); return Collections.emptyMap(); } } AllChannelMapExtractor(Set<String> channels); @Override Map<String, Value> extract(EvaluationContext context); @Override Set<String> getChannelIdentifiers(); }
AllChannelMapExtractor implements MapExtractor { @Override public Map<String, Value> extract(EvaluationContext context) { try { return context.get().getChannels().stream().collect(Collectors.toMap( channel -> channel, channel -> context.get().getValue(channel) )); } catch (Exception e) { logger.warn("could not extract all channel values", e); return Collections.emptyMap(); } } AllChannelMapExtractor(Set<String> channels); @Override Map<String, Value> extract(EvaluationContext context); @Override Set<String> getChannelIdentifiers();  }