@Override
    public boolean equals(Object o) {

        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        Within within = (Within) o;

        return timeRange != null ? timeRange.equals(within.timeRange) : within.timeRange == null;
    }
With time period for Incremental Aggregation.
modules/siddhi-query-api/src/main/java/io/siddhi/query/api/aggregation/Within.java