com.h3c.util

## Class JSONUtils

- java.lang.Object
- - com.h3c.util.JSONUtils

-     public class JSONUtils
      extends Object

  Set of utilities for producing JSON-encoded data.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `JSONUtils.Array` Abstraction of a JSON array.
    `static class` | `JSONUtils.Item` Abstraction of a JSON object.
    `static class` | `JSONUtils.Primitive` Abstraction of a JSON primitive (string, int, boolean) value.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <E extends Enum<E>> E` | `fromKey(Class<E> c, String key)` Create the Enum based on JSON key.
    `static String` | `toKey(Enum<?> e)` Create a string representation of JSON key based on the Enum name.

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

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

- - ### Method Detail

    - #### toKey

          public static String toKey(Enum<?> e)

      Create a string representation of JSON key based on the Enum name.
      Parameters:
        `e` - Enum of any type
      Returns:
        JSON key

    - #### fromKey

          public static <E extends Enum<E>> E fromKey(Class<E> c,
                                      String key)

      Create the Enum based on JSON key.
      Parameters:
        `c` - Enum type
        `key` - JSON key
      Returns:
        the Enum

Copyright © 2014. All Rights Reserved.