JSONPointer.Builder (JSON in Java 20240205 API)

Package org.json

## Class JSONPointer.Builder

- java.lang.Object
- - org.json.JSONPointer.Builder

- Enclosing class:
    JSONPointer

      public static class JSONPointer.Builder
      extends Object

  This class allows the user to build a JSONPointer in steps, using exactly one segment in each step.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Builder()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `JSONPointer.Builder` | `append​(int arrayIndex)` | Adds an integer to the reference token list.
    `JSONPointer.Builder` | `append​(String token)` | Adds an arbitrary token to the list of reference tokens.
    `JSONPointer` | `build()` | Creates a `JSONPointer` instance using the tokens previously set using the `append(String)` method calls.

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

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

- - ### Constructor Detail

    - #### Builder

          public Builder()

  - ### Method Detail

    - #### build

          public JSONPointer build()

      Creates a `JSONPointer` instance using the tokens previously set using the `append(String)` method calls.
      Returns:
        a JSONPointer object

    - #### append

          public JSONPointer.Builder append​(String token)

      Adds an arbitrary token to the list of reference tokens. It can be any non-null value. Unlike in the case of JSON string or URI fragment representation of JSON pointers, the argument of this method MUST NOT be escaped. If you want to query the property called `"a~b"` then you should simply pass the `"a~b"` string as-is, there is no need to escape it as `"a~0b"`.
      Parameters:
        `token` - the new token to be appended to the list
      Returns:
        `this`
      Throws:
        `NullPointerException` - if `token` is null

    - #### append

          public JSONPointer.Builder append​(int arrayIndex)

      Adds an integer to the reference token list. Although not necessarily, mostly this token will denote an array index.
      Parameters:
        `arrayIndex` - the array index to be added to the token list
      Returns:
        `this`