Package com.bazaarvoice.jolt
Class Sortr
java.lang.Object
com.bazaarvoice.jolt.Sortr
- All Implemented Interfaces:
JoltTransform
,Transform
Recursively sorts all maps within a JSON object into new sorted LinkedHashMaps so that serialized
representations are deterministic. Useful for debugging and making test fixtures.
Note this will make a copy of the input Map and List objects.
The sort order is standard alphabetical ascending, with a special case for "~" prefixed keys to be bumped to the top.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Standard alphabetical sort, with a special case for keys beginning with "~". -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
jsonKeyComparator
-
-
Constructor Details
-
Sortr
public Sortr()
-
-
Method Details
-
transform
Makes a "sorted" copy of the input JSON for human readability. -
sortJson
-
sortMap
-
ordered
-