Class JSONOperations


  • public final class JSONOperations
    extends java.lang.Object
    Backbone of our serialization.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object fromJSON​(java.lang.Class<?> toLoad, java.nio.file.Path path)
      Recover from JSON (with expose annotations)
      static void toJSON​(java.lang.Object dump, java.nio.file.Path path)
      Dump as JSON (with expose annotations)
      • Methods inherited from class java.lang.Object

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

      • toJSON

        public static void toJSON​(java.lang.Object dump,
                                  java.nio.file.Path path)
                           throws java.io.IOException
        Dump as JSON (with expose annotations)
        Parameters:
        dump - object of choice.
        path - destination.
        Throws:
        java.io.IOException - Upsy daisy.
      • fromJSON

        public static java.lang.Object fromJSON​(java.lang.Class<?> toLoad,
                                                java.nio.file.Path path)
                                         throws java.io.IOException
        Recover from JSON (with expose annotations)
        Parameters:
        toLoad - class structure of Object.
        path - of serialized JSON.
        Returns:
        Object of object (must be cast)
        Throws:
        java.io.IOException - if not existing.