public class ArrayUtils extends Object implements Serializable
| Constructor and Description |
|---|
ArrayUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
compare(com.fasterxml.jackson.databind.JsonNode left,
com.fasterxml.jackson.databind.JsonNode right)
Default comparison function for $sort
|
static com.fasterxml.jackson.databind.node.ArrayNode |
ensureArray(com.fasterxml.jackson.databind.JsonNode n)
If n is an array, it will be returned untouched.
|
static boolean |
isArrayOfNumbers(com.fasterxml.jackson.databind.JsonNode arr)
Determines if the supplied array contains all numeric values
|
static boolean |
isArrayOfStrings(com.fasterxml.jackson.databind.JsonNode arr)
Determines if the supplied array contains all String values
|
static com.fasterxml.jackson.databind.node.ArrayNode |
push(com.fasterxml.jackson.databind.node.ArrayNode left,
com.fasterxml.jackson.databind.JsonNode right)
Merges the left, then the right array into the resulting array, preserving
the element's order
|
static com.fasterxml.jackson.databind.node.ArrayNode |
slice(com.fasterxml.jackson.databind.node.ArrayNode array,
int start)
Returns a shallow copy of the portion of the supplied array from start
through the end of the array
|
static com.fasterxml.jackson.databind.node.ArrayNode |
slice(com.fasterxml.jackson.databind.node.ArrayNode array,
int start,
int end)
Returns a shallow copy of the portion of the supplied array from start to end
(not including end)
|
public static boolean isArrayOfNumbers(com.fasterxml.jackson.databind.JsonNode arr)
arr - the array to be evaluated.public static boolean isArrayOfStrings(com.fasterxml.jackson.databind.JsonNode arr)
arr - the array to be evaluated.public static boolean compare(com.fasterxml.jackson.databind.JsonNode left,
com.fasterxml.jackson.databind.JsonNode right)
throws EvaluateRuntimeException
left - string or number to be comparedright - string or number to be comparedEvaluateRuntimeException - if left and right can not be converted to
numberspublic static com.fasterxml.jackson.databind.node.ArrayNode ensureArray(com.fasterxml.jackson.databind.JsonNode n)
n - JsonNode being checkedpublic static com.fasterxml.jackson.databind.node.ArrayNode push(com.fasterxml.jackson.databind.node.ArrayNode left,
com.fasterxml.jackson.databind.JsonNode right)
left - first array to be mergedright - second array to be mergedpublic static com.fasterxml.jackson.databind.node.ArrayNode slice(com.fasterxml.jackson.databind.node.ArrayNode array,
int start,
int end)
array - start - end - public static com.fasterxml.jackson.databind.node.ArrayNode slice(com.fasterxml.jackson.databind.node.ArrayNode array,
int start)
array - input array to be slicedstart - starting index where the slice should occurCopyright © 2022. All rights reserved.