public final class JsPair extends Object
Modifier and Type | Field | Description |
---|---|---|
JsElem |
elem |
the json element.
|
JsPath |
path |
the location of the element.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(@Nullable Object that) |
Returns true if that is a pair and both represents the same element at the same location.
|
int |
hashCode() |
Returns the hashcode of this pair.
|
JsPair |
mapElem(UnaryOperator<JsElem> map) |
Returns a new pair with the same path and a new element result of applying the mapping function
|
JsPair |
mapPath(UnaryOperator<JsPath> map) |
Returns a new pair with the same element and a new path result of applying the mapping function
|
static JsPair |
of(String path,
JsElem elem) |
Returns a json pair from the path-like string and the json element.
|
static JsPair |
of(JsPath path,
JsElem elem) |
Returns a json pair from the path and the json element.
|
String |
toString() |
public final JsElem elem
public final JsPath path
public static JsPair of(String path, JsElem elem)
path
- the path-like stringelem
- the JsElempublic static JsPair of(JsPath path, JsElem elem)
path
- the JsPath objectelem
- the JsElempublic String toString()
public boolean equals(@Nullable Object that)
public int hashCode()
public JsPair mapElem(UnaryOperator<JsElem> map)
map
- the mapping function which maps the JsElempublic JsPair mapPath(UnaryOperator<JsPath> map)
map
- the mapping function which maps the JsPathCopyright © 2019. All rights reserved.