Class JsonBuilder

    • Field Detail

      • root

        public int root
    • Constructor Detail

      • JsonBuilder

        public JsonBuilder()
        Instantiates a new Json builder.
      • JsonBuilder

        public JsonBuilder​(SafeHandle handle,
                           int root)
        Instantiates a new Json builder.
        Parameters:
        handle - the handle
    • Method Detail

      • addItem

        public int addItem​(int item,
                           int index,
                           String find)
        Adds an item to the specified ajv item
        Parameters:
        item - the specified ajv item to add to
        index - the index to add the new item at
        find - the json key to associate with the new item
        Returns:
        the ajv item added
      • setJson

        public int setJson​(int item,
                           String json)
        Sets the json of the specified ajv item
        Parameters:
        item - the specified ajv item to set the value of
        json - the json value to associate with the item
        Returns:
        HR indicating success or failure
      • setString

        public int setString​(int item,
                             String str)
        Sets the string of the specified ajv item
        Parameters:
        item - the specified ajv item to set the value of
        str - the string value to associate with the item
        Returns:
        HR indicating success or failure
      • setBoolean

        public int setBoolean​(int item,
                              boolean value)
        Sets the boolean of the specified ajv item
        Parameters:
        item - the specified ajv item to set the value of
        value - the boolean value to associate with the item
        Returns:
        HR indicating success or failure
      • setInteger

        public int setInteger​(int item,
                              int integer)
        Sets the integer of the specified ajv item
        Parameters:
        item - the specified ajv item to set the value of
        integer - the integer value to associate with the item
        Returns:
        HR indicating success or failure
      • setDouble

        public int setDouble​(int item,
                             double value)
        Sets the double of the specified ajv item
        Parameters:
        item - the specified ajv item to set the value of
        value - the double value to associate with the item
        Returns:
        HR indicating success or failure
      • toString

        public String toString()
        Returns the string representation of the json.
        Overrides:
        toString in class Object