com.h3c.util.health

## Class StateAggregator

- java.lang.Object
- - com.h3c.util.health.StateAggregator

-     public class StateAggregator
      extends Object

  This class provides the facility to examine an instance of `Health`, and compute an aggregate state based on the contributed states to each category, setting that derived state on the instance. By using the no-args constructor, the default aggregation algorithm will be used, which returns the "most critical" `State` discovered.

  An alternate aggregation algorithm may be installed by calling the constructor that takes an `StateAggregator.Algorithm` implementation as a parameter.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `StateAggregator.Algorithm` The aggregation computation algorithm interface.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StateAggregator()` Constructs a state aggregator that uses the default aggregation algorithm.
    `StateAggregator(StateAggregator.Algorithm algorithm)` Constructs a state aggregator that uses the specified aggregation algorithm.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<C extends Enum<C>> void` | `aggregate(Health<C> health)` Applies the aggregation computation and sets the result as the aggregate state on the specified health object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StateAggregator

          public StateAggregator()

      Constructs a state aggregator that uses the default aggregation algorithm.

    - #### StateAggregator

          public StateAggregator(StateAggregator.Algorithm algorithm)

      Constructs a state aggregator that uses the specified aggregation algorithm.
      Parameters:
        `algorithm` - the algorithm implementation to use

  - ### Method Detail

    - #### aggregate

          public final <C extends Enum<C>> void aggregate(Health<C> health)

      Applies the aggregation computation and sets the result as the aggregate state on the specified health object.
      Parameters:
        `health` - the instance on which to operate

Copyright © 2014. All Rights Reserved.