Class JsonPointer
- java.lang.Object
-
- io.openapiprocessor.jsonschema.schema.JsonPointer
-
public class JsonPointer extends java.lang.ObjectJSON pointer abstraction based on rfc6901.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonPointerappend(int index)creates a new json pointer appending the given index to the pointer.JsonPointerappend(java.lang.String token)creates a new json pointer appending the given token.static JsonPointerempty()booleanequals(@Nullable java.lang.Object o)static JsonPointerfrom(@Nullable java.lang.String jsonPointer)java.lang.StringgetJsonPointer(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.inthashCode()booleanisEmpty()java.lang.Stringtail()get the last token of the pointer.inttailIndex()get the last token of the pointer as array index.java.lang.StringtoString()java.net.URItoUri()
-
-
-
Method Detail
-
empty
public static JsonPointer empty()
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-