Class JsonSorter


  • public class JsonSorter
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonSorter()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String sort​(java.lang.String input)
      Sorts the JSON string into a new JSON string with keys ordered alphabetically (recursive) Relies on the fact that JsonObjects use a LinkedHashMap internally, which maintains the order of the keys, as they are inserted.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonSorter

        public JsonSorter()
    • Method Detail

      • sort

        public static java.lang.String sort​(java.lang.String input)
        Sorts the JSON string into a new JSON string with keys ordered alphabetically (recursive) Relies on the fact that JsonObjects use a LinkedHashMap internally, which maintains the order of the keys, as they are inserted.
        Parameters:
        input - JSON string to sort
        Returns:
        sorted JSON string