Class WindowedValue<T>

  • Type Parameters:
    T - the type of the value

    @Internal
    public abstract class WindowedValue<T>
    extends java.lang.Object
    An immutable triple of value, timestamp, and windows.
    • Constructor Detail

      • WindowedValue

        public WindowedValue()
    • Method Detail

      • of

        public static <T> WindowedValue<T> of​(T value,
                                              org.joda.time.Instant timestamp,
                                              java.util.Collection<? extends BoundedWindow> windows,
                                              PaneInfo pane)
        Returns a WindowedValue with the given value, timestamp, and windows.
      • of

        public static <T> WindowedValue<T> of​(T value,
                                              org.joda.time.Instant timestamp,
                                              BoundedWindow window,
                                              PaneInfo pane)
        Returns a WindowedValue with the given value, timestamp, and window.
      • valueInGlobalWindow

        public static <T> WindowedValue<T> valueInGlobalWindow​(T value)
        Returns a WindowedValue with the given value in the GlobalWindow using the default timestamp and pane.
      • valueInGlobalWindow

        public static <T> WindowedValue<T> valueInGlobalWindow​(T value,
                                                               PaneInfo pane)
        Returns a WindowedValue with the given value in the GlobalWindow using the default timestamp and the specified pane.
      • timestampedValueInGlobalWindow

        public static <T> WindowedValue<T> timestampedValueInGlobalWindow​(T value,
                                                                          org.joda.time.Instant timestamp)
        Returns a WindowedValue with the given value and timestamp, GlobalWindow and default pane.
      • timestampedValueInGlobalWindow

        public static <T> WindowedValue<T> timestampedValueInGlobalWindow​(T value,
                                                                          org.joda.time.Instant timestamp,
                                                                          PaneInfo paneInfo)
        Returns a WindowedValue with the given value, timestamp, and pane in the GlobalWindow.
      • withValue

        public abstract <NewT> WindowedValue<NewT> withValue​(NewT value)
        Returns a new WindowedValue that is a copy of this one, but with a different value, which may have a new type NewT.
      • getValue

        public abstract T getValue()
        Returns the value of this WindowedValue.
      • getTimestamp

        public abstract org.joda.time.Instant getTimestamp()
        Returns the timestamp of this WindowedValue.
      • getWindows

        public abstract java.util.Collection<? extends BoundedWindow> getWindows()
        Returns the windows of this WindowedValue.
      • getPane

        public abstract PaneInfo getPane()
        Returns the pane of this WindowedValue in its window.
      • isSingleWindowedValue

        public boolean isSingleWindowedValue()
        Returns true if this WindowedValue has exactly one window.
      • explodeWindows

        public java.lang.Iterable<WindowedValue<T>> explodeWindows()
        Returns a collection of WindowedValues identical to this one, except each is in exactly one of the windows that this WindowedValue is in.
      • equals

        public boolean equals​(@Nullable java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public abstract java.lang.String toString()
        Overrides:
        toString in class java.lang.Object