Class JsonPointer


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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      JsonPointer append​(int index)
      creates a new json pointer appending the given index to the pointer.
      JsonPointer append​(java.lang.String token)
      creates a new json pointer appending the given token.
      static JsonPointer empty()  
      boolean equals​(@Nullable java.lang.Object o)  
      static JsonPointer from​(@Nullable java.lang.String jsonPointer)  
      java.lang.String getJsonPointer​(java.lang.String token)
      creates a new json pointer appending the given token.
      java.util.List<java.lang.String> getTokens()
      gets the unescaped tokens of this pointer.
      int hashCode()  
      boolean isEmpty()  
      java.lang.String tail()
      get the last token of the pointer.
      int tailIndex()
      get the last token of the pointer as array index.
      java.lang.String toString()  
      java.net.URI toUri()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • 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