com.h3c.util

## Class JSONUtils.Item

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

- Enclosing class:
    JSONUtils

      public static class JSONUtils.Item
      extends JSONUtils.Primitive

  Abstraction of a JSON object.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JSONUtils.Item()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `JSONUtils.Item` | `add(Enum<?> name, boolean item)` Add a named item property to the object.
    `JSONUtils.Item` | `add(Enum<?> name, Enum<?> item)` Add a named property to the object.
    `JSONUtils.Item` | `add(Enum<?> name, JSONUtils.Primitive item)` Add a named item property to the object.
    `JSONUtils.Item` | `add(Enum<?> name, long item)` Add a named item property to the object.
    `JSONUtils.Item` | `add(Enum<?> name, String item)` Add a named item property to the object.
    `JSONUtils.Item` | `add(String name, boolean item)` Add a named item property to the object.
    `JSONUtils.Item` | `add(String name, Enum<?> item)` Add a named item property to the object.
    `JSONUtils.Item` | `add(String name, JSONUtils.Primitive item)` Add a named item property to the object.
    `JSONUtils.Item` | `add(String name, long item)` Add a named item property to the object.
    `JSONUtils.Item` | `add(String name, String item)` Add a named item property to the object.
    `boolean` | `equals(Object o)`
    `JSONUtils.Primitive` | `get(String key)` Get the entity bound to the specified key in this item.
    `int` | `hashCode()`
    `JSONUtils.Item` | `inline()` Mark the specified item to be formatted in-line.
    `Set<String>` | `keys()` Get the set of keys holding values within this item.
    `JSONUtils.Item` | `remove(Enum<?> name)` Remove a named property from the object.
    `JSONUtils.Item` | `remove(String name)` Remove a named property from the object.
    `int` | `size()` Returns the number of items contained within this item.
    `String` | `toString()`

    - ### Methods inherited from class com.h3c.util.JSONUtils.Primitive

      `isInline`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### JSONUtils.Item

          public JSONUtils.Item()

  - ### Method Detail

    - #### inline

          public JSONUtils.Item inline()

      Description copied from class: `JSONUtils.Primitive`
      Mark the specified item to be formatted in-line.
      Overrides:
        `inline` in class `JSONUtils.Primitive`
      Returns:
        the item

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `JSONUtils.Primitive`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `JSONUtils.Primitive`

    - #### size

          public int size()

      Returns the number of items contained within this item.
      Returns:
        the number of contained items

    - #### keys

          public Set<String> keys()

      Get the set of keys holding values within this item.
      Returns:
        set of keys

    - #### get

          public JSONUtils.Primitive get(String key)

      Get the entity bound to the specified key in this item.
      Parameters:
        `key` - entity key
      Returns:
        entity bound to the given key

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `JSONUtils.Primitive`

    - #### add

          public JSONUtils.Item add(Enum<?> name,
                           JSONUtils.Primitive item)

      Add a named item property to the object.
      Parameters:
        `name` - property name (as an enum constant)
        `item` - item to be added
      Returns:
        the modified object
      Throws:
        `NullPointerException` - if parameter is null

    - #### add

          public JSONUtils.Item add(String name,
                           JSONUtils.Primitive item)

      Add a named item property to the object.
      Parameters:
        `name` - property name
        `item` - item to be added
      Returns:
        the modified object
      Throws:
        `NullPointerException` - if parameter is null

    - #### add

          public JSONUtils.Item add(Enum<?> name,
                           String item)

      Add a named item property to the object.
      Parameters:
        `name` - property name (as an enum constant)
        `item` - item to be added
      Returns:
        the modified object
      Throws:
        `NullPointerException` - if parameter is null

    - #### add

          public JSONUtils.Item add(String name,
                           String item)

      Add a named item property to the object.
      Parameters:
        `name` - property name
        `item` - item to be added
      Returns:
        the modified object
      Throws:
        `NullPointerException` - if parameter is null

    - #### add

          public JSONUtils.Item add(Enum<?> name,
                           long item)

      Add a named item property to the object.
      Parameters:
        `name` - property name (as an enum constant)
        `item` - item to be added
      Returns:
        the modified object
      Throws:
        `NullPointerException` - if parameter is null

    - #### add

          public JSONUtils.Item add(String name,
                           long item)

      Add a named item property to the object.
      Parameters:
        `name` - property name
        `item` - item to be added
      Returns:
        the modified object
      Throws:
        `NullPointerException` - if parameter is null

    - #### add

          public JSONUtils.Item add(Enum<?> name,
                           boolean item)

      Add a named item property to the object.
      Parameters:
        `name` - property name (as an enum constant)
        `item` - item to be added
      Returns:
        the modified object
      Throws:
        `NullPointerException` - if parameter is null

    - #### add

          public JSONUtils.Item add(String name,
                           boolean item)

      Add a named item property to the object.
      Parameters:
        `name` - property name
        `item` - item to be added
      Returns:
        the modified object
      Throws:
        `NullPointerException` - if parameter is null

    - #### add

          public JSONUtils.Item add(Enum<?> name,
                           Enum<?> item)

      Add a named property to the object.
      Parameters:
        `name` - property name (as an enum constant)
        `item` - item to be added
      Returns:
        the modified object
      Throws:
        `NullPointerException` - if parameter is null

    - #### add

          public JSONUtils.Item add(String name,
                           Enum<?> item)

      Add a named item property to the object.
      Parameters:
        `name` - property name
        `item` - item to be added
      Returns:
        the modified object
      Throws:
        `NullPointerException` - if parameter is null

    - #### remove

          public JSONUtils.Item remove(Enum<?> name)

      Remove a named property from the object.
      Parameters:
        `name` - property name (as an enum constant)
      Returns:
        the modified object
      Throws:
        `NullPointerException` - if parameter is null

    - #### remove

          public JSONUtils.Item remove(String name)

      Remove a named property from the object.
      Parameters:
        `name` - property name
      Returns:
        the modified object
      Throws:
        `NullPointerException` - if parameter is null

Copyright © 2014. All Rights Reserved.