Class JsonPath
- java.lang.Object
-
- io.wcm.caravan.io.jsontransform.element.JsonPath
-
@ProviderType public final class JsonPath extends Object
Minimal implementation of the JSON path API.
-
-
Constructor Summary
Constructors Constructor Description JsonPath(List<JsonElement> elements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(String query)
boolean
endsWith(String query)
JsonElement
getLast()
JsonElement
getLast(int steps)
boolean
isEqualTo(String query)
int
size()
boolean
startsWith(String query)
String
toString()
-
-
-
Constructor Detail
-
JsonPath
public JsonPath(List<JsonElement> elements)
- Parameters:
elements
- Passed elements
-
-
Method Detail
-
contains
public boolean contains(String query)
- Parameters:
query
- JSON path query- Returns:
- True if bread crumb contains query
-
startsWith
public boolean startsWith(String query)
- Parameters:
query
- JSON path query- Returns:
- True if bread crumb starts with query
-
endsWith
public boolean endsWith(String query)
- Parameters:
query
- JSON path query- Returns:
- True if bread crumb ends with query
-
isEqualTo
public boolean isEqualTo(String query)
- Parameters:
query
- JSON path query- Returns:
- True if bread crumb equals query
-
getLast
public JsonElement getLast()
- Returns:
- The last passed element in the bread crumb
-
getLast
public JsonElement getLast(int steps)
- Parameters:
steps
- Number of steps- Returns:
- The top-
steps
last passed element in the bread crumb
-
size
public int size()
- Returns:
- The number of passed elements in the bread crumb
-
-