Class JsonPointer


  • public class JsonPointer
    extends java.lang.Object
    JSON pointer abstraction based on rfc6901.
    • Method Detail

      • fromFragment

        @Deprecated
        public static JsonPointer fromFragment​(java.lang.String fragment)
        Deprecated.
        creates a json pointer from a uri fragment string. Throws if the fragment is not a valid json pointer.
        Parameters:
        fragment - json pointer fragment
        Returns:
        a json pointer object
      • from

        public static JsonPointer from​(@Nullable java.lang.String jsonPointer)
      • append

        public JsonPointer append​(java.lang.String token)
        creates a new json pointer appending the given token.
        Parameters:
        token - token to append
        Returns:
        new json pointer
      • append

        public JsonPointer append​(int index)
        creates a new json pointer appending the given index to the pointer.
        Parameters:
        index - the index
        Returns:
        new json pointer to index
      • getJsonPointer

        public java.lang.String getJsonPointer​(java.lang.String token)
        creates a new json pointer appending the given token.
        Parameters:
        token - token to append
        Returns:
        new json pointer string
      • toUri

        public java.net.URI toUri()
      • tail

        public java.lang.String tail()
        get the last token of the pointer.
        Returns:
        last token
      • tailIndex

        public int tailIndex()
        get the last token of the pointer as array index.
        Returns:
        last token array index
      • getTokens

        public java.util.List<java.lang.String> getTokens()
        gets the unescaped tokens of this pointer.
        Returns:
        tokens.
      • isEmpty

        public boolean isEmpty()
      • equals

        public boolean equals​(@Nullable java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object