@Test public void testMinusBefore() throws IOException { BundleFilterTimeRange filter = Configs.decodeObject(BundleFilterTimeRange.class, "time:TIME, before:-100000"); assertFalse(filter.filter(bundle)); }
@Override public boolean filter(Bundle bundle) { ValueLong timeValue = time.getValue(bundle).asLong(); if (timeValue == null) { return defaultExit; } long unixTime = timeValue.getLong(); if (before != null && unixTime > tbefore) { return false; } if (after != null && unixTime < tafter) { return false; } return defaultExit; }
BundleFilterTimeRange implements BundleFilter { @Override public boolean filter(Bundle bundle) { ValueLong timeValue = time.getValue(bundle).asLong(); if (timeValue == null) { return defaultExit; } long unixTime = timeValue.getLong(); if (before != null && unixTime > tbefore) { return false; } if (after != null && unixTime < tafter) { return false; } return defaultExit; } }
BundleFilterTimeRange implements BundleFilter { @Override public boolean filter(Bundle bundle) { ValueLong timeValue = time.getValue(bundle).asLong(); if (timeValue == null) { return defaultExit; } long unixTime = timeValue.getLong(); if (before != null && unixTime > tbefore) { return false; } if (after != null && unixTime < tafter) { return false; } return defaultExit; } @JsonCreator  BundleFilterTimeRange(@JsonProperty(value = "time", required = true) AutoField time,
                                 @JsonProperty("before") String before,
                                 @JsonProperty("after") String after,
                                 @JsonProperty("defaultExit") boolean defaultExit,
                                 @JsonProperty("timeFormat") String timeFormat,
                                 @JsonProperty("timeZone") String timeZone); }
BundleFilterTimeRange implements BundleFilter { @Override public boolean filter(Bundle bundle) { ValueLong timeValue = time.getValue(bundle).asLong(); if (timeValue == null) { return defaultExit; } long unixTime = timeValue.getLong(); if (before != null && unixTime > tbefore) { return false; } if (after != null && unixTime < tafter) { return false; } return defaultExit; } @JsonCreator  BundleFilterTimeRange(@JsonProperty(value = "time", required = true) AutoField time,
                                 @JsonProperty("before") String before,
                                 @JsonProperty("after") String after,
                                 @JsonProperty("defaultExit") boolean defaultExit,
                                 @JsonProperty("timeFormat") String timeFormat,
                                 @JsonProperty("timeZone") String timeZone); @Override boolean filter(Bundle bundle); }
BundleFilterTimeRange implements BundleFilter { @Override public boolean filter(Bundle bundle) { ValueLong timeValue = time.getValue(bundle).asLong(); if (timeValue == null) { return defaultExit; } long unixTime = timeValue.getLong(); if (before != null && unixTime > tbefore) { return false; } if (after != null && unixTime < tafter) { return false; } return defaultExit; } @JsonCreator  BundleFilterTimeRange(@JsonProperty(value = "time", required = true) AutoField time,
                                 @JsonProperty("before") String before,
                                 @JsonProperty("after") String after,
                                 @JsonProperty("defaultExit") boolean defaultExit,
                                 @JsonProperty("timeFormat") String timeFormat,
                                 @JsonProperty("timeZone") String timeZone); @Override boolean filter(Bundle bundle);  }