Class AggregationWithHeaders<AGG>

java.lang.Object
org.apache.kafka.streams.state.AggregationWithHeaders<AGG>
Type Parameters:
AGG - the aggregation type

public final class AggregationWithHeaders<AGG> extends Object
Combines an aggregated value with its associated record headers. This is used by SessionStoreWithHeaders to store session aggregations along with headers.
  • Method Details

    • make

      public static <AGG> AggregationWithHeaders<AGG> make(AGG aggregation, Headers headers)
      Create a new AggregationWithHeaders instance if the provided aggregation is not null.
      Type Parameters:
      AGG - the type of the aggregation
      Parameters:
      aggregation - the aggregation
      headers - the headers (may be null, treated as empty)
      Returns:
      a new AggregationWithHeaders instance if the provided aggregation is not null; otherwise null is returned
    • makeAllowNullable

      public static <AGG> AggregationWithHeaders<AGG> makeAllowNullable(AGG aggregation, Headers headers)
      Create a new AggregationWithHeaders instance. The provided aggregation may be null.
      Type Parameters:
      AGG - the type of the aggregation
      Parameters:
      aggregation - the aggregation (may be null)
      headers - the headers (may be null, treated as empty)
      Returns:
      a new AggregationWithHeaders instance
    • getAggregationOrNull

      public static <AGG> AGG getAggregationOrNull(AggregationWithHeaders<AGG> aggregationWithHeaders)
      Return the wrapped aggregation of the given aggregationWithHeaders parameter if the parameter is not null.
      Type Parameters:
      AGG - the type of the aggregation
      Parameters:
      aggregationWithHeaders - an AggregationWithHeaders instance; can be null
      Returns:
      the wrapped aggregation of aggregationWithHeaders if not null; otherwise null
    • aggregation

      public AGG aggregation()
    • headers

      public Headers headers()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object