@Test public void testGetWindow() throws Exception { final String json = "{\n" + " \"operator\" : \"last\",\n" + " \"duration\" : \"1h\"\n" + "}"; LastFilter lastFilter = objectMapper.readValue(json, LastFilter.class); TimeWindow timeWindow = lastFilter.getWindow(); Assert.assertTrue((timeWindow.getEndTime() - timeWindow.getStartTime()) == 3600000); }
@JsonIgnore public TimeWindow getWindow() { return WindowUtil.calculate(currentTime, duration, roundingMode); }
LastFilter extends Filter { @JsonIgnore public TimeWindow getWindow() { return WindowUtil.calculate(currentTime, duration, roundingMode); } }
LastFilter extends Filter { @JsonIgnore public TimeWindow getWindow() { return WindowUtil.calculate(currentTime, duration, roundingMode); } LastFilter(); @Builder  LastFilter(String field, long currentTime, Duration duration, RoundingMode roundingMode); }
LastFilter extends Filter { @JsonIgnore public TimeWindow getWindow() { return WindowUtil.calculate(currentTime, duration, roundingMode); } LastFilter(); @Builder  LastFilter(String field, long currentTime, Duration duration, RoundingMode roundingMode); void setDuration(Duration duration); @Override T accept(FilterVisitor<T> visitor); @JsonIgnore TimeWindow getWindow(); @Override @JsonIgnore boolean isFilterTemporal(); }
LastFilter extends Filter { @JsonIgnore public TimeWindow getWindow() { return WindowUtil.calculate(currentTime, duration, roundingMode); } LastFilter(); @Builder  LastFilter(String field, long currentTime, Duration duration, RoundingMode roundingMode); void setDuration(Duration duration); @Override T accept(FilterVisitor<T> visitor); @JsonIgnore TimeWindow getWindow(); @Override @JsonIgnore boolean isFilterTemporal();  }