Class TrajectoryUtil


  • public final class TrajectoryUtil
    extends Object
    • Method Detail

      • fromPathweaverJson

        public static Trajectory fromPathweaverJson​(Path path)
                                             throws IOException
        Imports a Trajectory from a PathWeaver-style JSON file.
        Parameters:
        path - the path of the json file to import from
        Returns:
        The trajectory represented by the file.
        Throws:
        IOException - if reading from the file fails
      • toPathweaverJson

        public static void toPathweaverJson​(Trajectory trajectory,
                                            Path path)
                                     throws IOException
        Exports a Trajectory to a PathWeaver-style JSON file.
        Parameters:
        trajectory - the trajectory to export
        path - the path of the file to export to
        Throws:
        IOException - if writing to the file fails
      • deserializeTrajectory

        public static Trajectory deserializeTrajectory​(String json)
                                                throws com.fasterxml.jackson.core.JsonProcessingException
        Deserializes a Trajectory from PathWeaver-style JSON.
        Parameters:
        json - the string containing the serialized JSON
        Returns:
        the trajectory represented by the JSON
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - if deserializing the JSON fails
      • serializeTrajectory

        public static String serializeTrajectory​(Trajectory trajectory)
                                          throws com.fasterxml.jackson.core.JsonProcessingException
        Serializes a Trajectory to PathWeaver-style JSON.
        Parameters:
        trajectory - the trajectory to export
        Returns:
        the string containing the serialized JSON
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - if serializing the Trajectory fails