com.h3c.util

## Class JSONUtils.Primitive

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

- Direct Known Subclasses:
    JSONUtils.Array, JSONUtils.Item
  Enclosing class:
    JSONUtils

      public static class JSONUtils.Primitive
      extends Object

  Abstraction of a JSON primitive (string, int, boolean) value.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JSONUtils.Primitive(boolean item)` Create a JSON primitive with the specified boolean value.
    `JSONUtils.Primitive(Enum<?> item)` Create a JSON primitive with the specified enum value
    `JSONUtils.Primitive(long item)` Create a JSON primitive with the specified numeric value.
    `JSONUtils.Primitive(String item)` Create a JSON primitive with the specified string value.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `int` | `hashCode()`
    `JSONUtils.Primitive` | `inline()` Mark the specified item to be formatted in-line.
    `boolean` | `isInline()` Indicate whether the item will be formatted in-line.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### JSONUtils.Primitive

          public JSONUtils.Primitive(String item)

      Create a JSON primitive with the specified string value.
      Parameters:
        `item` - item string value
      Throws:
        `NullPointerException` - if the parameter is null

    - #### JSONUtils.Primitive

          public JSONUtils.Primitive(long item)

      Create a JSON primitive with the specified numeric value.
      Parameters:
        `item` - item numeric value

    - #### JSONUtils.Primitive

          public JSONUtils.Primitive(boolean item)

      Create a JSON primitive with the specified boolean value.
      Parameters:
        `item` - the boolean value

    - #### JSONUtils.Primitive

          public JSONUtils.Primitive(Enum<?> item)

      Create a JSON primitive with the specified enum value
      Parameters:
        `item` - item numeric value
      Throws:
        `NullPointerException` - if the parameter is null

  - ### Method Detail

    - #### inline

          public JSONUtils.Primitive inline()

      Mark the specified item to be formatted in-line.
      Returns:
        the item

    - #### isInline

          public boolean isInline()

      Indicate whether the item will be formatted in-line.
      Returns:
        true if item will use in-line formatting; false otherwise

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2014. All Rights Reserved.