Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Add EnumerableWindowDefinition to Windows and deprecate it

Includes deprecating size() and delegating maxSize() to size() to for compatibility.

Code Block
languagejava
titledeprecation
/**
 * ... the javadoc doesn't change
 *
 * @deprecated since 2.7 Implement EnumerableWindowDefinition instead.
 */
@Deprecated
public abstract class Windows<W extends Window> implements EnumerableWindowDefinition<W> {
    /**
     * Return an upper bound on the size of the specified windows in milliseconds.
     * Used to determine the lower bound on store retention time.
     *
     * @return the size of the specified window
     */
    public long maxSize() {
        return size();
    }

    /**
     * Return the size of the specified windows in milliseconds.
     *
     * @return the size of the specified windows
     * @deprecated since 2.7 Override maxSize() instead. nothing else changes
     */
    @Deprecated
    public abstract long size();
}

Swap out the argument type in windowBy

...