com.h3c.util.health

## Class HealthUtils

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

-     public class HealthUtils
      extends Object

  This class provides auxiliary support for encoding/decoding Health instances.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HealthUtils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <C extends Enum<C>> Health<C>` | `decode(String blueprint)` Produces an instance of health from a blueprint string previously generated via the `encode(Health)` method.
    `static <C extends Enum<C>> String` | `encode(Health<C> health)` Takes a health instance and produces a string representation of that instance, which can later be used to reconstitute an equivalent instance, via the `decode(String)` method.
    `static String` | `preserveClassCodecs()`
    `static void` | `restoreClassCodecs(String memento)` Restore the codecs using the supplied memento string.

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

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

- - ### Constructor Detail

    - #### HealthUtils

          public HealthUtils()

  - ### Method Detail

    - #### preserveClassCodecs

          public static String preserveClassCodecs()

    - #### restoreClassCodecs

          public static void restoreClassCodecs(String memento)

      Restore the codecs using the supplied memento string.
      Parameters:
        `memento` - memento containing the encoding of the codecs

    - #### encode

          public static <C extends Enum<C>> String encode(Health<C> health)

      Takes a health instance and produces a string representation of that instance, which can later be used to reconstitute an equivalent instance, via the `decode(String)` method.
      Parameters:
        `health` - the instance to encode
      Returns:
        the string representation

    - #### decode

          public static <C extends Enum<C>> Health<C> decode(String blueprint)

      Produces an instance of health from a blueprint string previously generated via the `encode(Health)` method.
      Parameters:
        `blueprint` - the string representation
      Returns:
        an instance of health
      Throws:
        `NullPointerException` - if blueprint is null
        `IllegalArgumentException` - if blueprint cannot be decoded correctly

Copyright © 2014. All Rights Reserved.